Changes between Version 21 and Version 22 of Development/CodeConventions
- Timestamp:
- 03/22/10 03:32:41 (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Development/CodeConventions
v21 v22 34 34 * If a function does several things in a regular way, then it should look like that in the source code. This means you should line up arguments to similar function calls. For example, use this: 35 35 {{{ 36 = do someFunction "Monday" (23, 23) (Just 'a')37 someOtherFunction "Tuesday" ("this", "that") Nothing38 anotherFunction "Wednesday" ('a', 'b')36 = do someFunction "Monday" (23, 23) (Just 'a') 37 someOtherFunction "Tuesday" ("this", "that") Nothing 38 anotherFunction "Wednesday" ('a', 'b') 39 39 }}} 40 40 41 41 instead of this: 42 42 {{{ 43 = do someFunction "Monday" (23, 23) (Just 'a')44 someOtherFunction "Tuesday" ("this", "that") Nothing45 anotherFunction "Wednesday" ('a', 'b')43 = do someFunction "Monday" (23, 23) (Just 'a') 44 someOtherFunction "Tuesday" ("this", "that") Nothing 45 anotherFunction "Wednesday" ('a', 'b') 46 46 }}} 47 47 48 * For the same reason, line up the '=' signs in groups of bindings. For example, use this: 49 {{{ 50 let thing = some stuff 51 someOtherThing = some more stuff 52 oneLastThing = still more stuff 53 in ... 54 }}} 55 56 instead of this: 57 {{{ 58 let thing = some stuff 59 someOtherThing = some more stuff 60 oneLastThing = still more stuff 61 in ... 62 }}} 48 63 49 64
