
1 Jul
2013
1 Jul
'13
11:51 a.m.
Code which is part of some expression should be indented further in than the beginning of that expression [...]
Yes. Then the next question is "how much further in". My answer is: it does not matter, but make it consistent (like 4 spaces), with the implication that indentation should *not* depend on length of identifiers in the previous line(s) Example (bad): foo x = do bar baz Example (good): foo x = do bar baz Reason: when refactoring later changes the name "foo", or the number or names of its arguments, you'll have to re-indent code (in the "bad" version): (a) this needs tool support and (b) it creates noise in the diffs. - J.W.