Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: source code layout question

From: carl:cybercraft at: 5-Jan-2002 13:19

On 05-Jan-02, Andrew Martin wrote:
> * Title and Upper case for important words helps emphasize that > these words are defined here.
I used to use upper and lower case to distinguish variables from function names and the like in previous languages, (leading lowercase for variables, leading uppercase for functions or labels), but dropped it in REBOL, "there only being words in REBOL". Here's an example from one of my first REBOL scripts (before I'd been pointed towards the style-guide - all non-REBOL words I'd give the uppercase treatment to)... NoChange: [ LowWait: WaitAmount if WaitAmount < WaitMax [ WaitAmount: to-integer (WaitAmount * 2) if WaitAmount > WaitMax [WaitAmount: WaitMax] do UpdateSpeed ] ] And how we're supposed to write it... no-change: [ low-wait: wait-amount if wait-amount < wait-max [ wait-amount: to-integer (wait-amount * 2) if wait-amount > wait-max [wait-amount: wait-max] do update-speed ] ] Take your pick I guess, but the "proper" way seems easier on the eye (and the shift-key:) though its look could depend a lot on the font you're using I guess. -- Carl Read