[REBOL] Re: source code layout question
From: al:bri:xtra at: 5-Jan-2002 6:10
Hi, Joel.
I prefer:
Foo: func [
"Computes a Euclid string for numeric data."
X [integer!] "Major argument."
Y [integer!] "Corporal argument."
Z [integer!] "Seed string, modified by evaluation."
][
either X = 0 [
Z
][
either Y = 0 [
head reverse Z
][
while [X < Y][
Y: Y - X
append Z "x"
]
foo Y X Z
]
]
]
Why?
* Title and Upper case for important words helps emphasize that these
words are defined here.
* Leading opening square bracket "[" allows cutting and pasting into
Rebol console.
* Block contents and trailing closing square bracket "]" all indented to
same level to visually confirm nesting.
* "][" for 'either provides visual cue for alternative case for 'either
and continued blocks for functions.
* For comments: Full stops inserted to make better sentences, along with
initial capital.
Andrew Martin
ICQ: 26227169 http://valley.150m.com/