http://qs321.pair.com?node_id=143845


in reply to (OT) Editor-neutral code formatting

If you really need to think about indenting, your code is too convoluted. Break it into more functions that do less. Otherwise you don't need to think long about it, so it is not important.

Case 1 you present is an example of a piece of code where indenting style really does not matter.

Case 2 you present is not really hard, either, but if you feel that indentation really matters there, you should rewrite it breaking it into more functions.

I often find myself playing around with several ways to indent a particular line of code (in Emacs, so "playing" is the right word), only to notice later that is has vanished because I had to introduce a function to hide the complexity from my bug-introducing typing fingers ...

As for the other side of indenting conventions (ensuring a consistent layout for whatever reason) - only tools will help here, as long as people view an indenting style as part of their personality. (Hint: they should worry about more important things ... )

Christian Lemburg
Brainbench MVP for Perl
http://www.brainbench.com