2 ms·
With white-space insensitive code I can easily cut/paste code from one function to another, without having to potentially manually re-indent it afterwards. This
by logicchains 6y ago
With white-space insensitive code I can easily cut/paste code from one function to another, without having to potentially manually re-indent it afterwards. This makes refactoring easier.
For formatting, it means I never need to manually add any spaces or tabs: the formatter always knows exactly how to indent it. With whitespace-sensitive code, I have to manually pick the indentation, as different indentations could have different semantics. That's why if I hit tab in Emacs when editing a Haskell file, it will cycle through multiple possible indentions. If I hit it in a whitespace-insensitive language, it will just move it to the "correct" indentation straight away and I don't need to worry about it.
Using {} braces in Haskell seems less intuitive, at least to me. E.g. how would I use braces to avoid the need to manually indent a nested where statement?
- gnufx 6y agoI have to fix up the layout essentially manually every time I have to edit C in someone else's idea of correct layout when they haven't included C Mode rules for it. (That's assuming they want a consistent style for changes, of course.) If simplicity of parsing, and cut-and-paste are important, we should be using Lisp, of course, but there are still different indentation styles.
- frank2 6y ago>how would I use braces to avoid the need to manually indent a nested where statement? Warning: untested code main = printLn (foo * bar) where {foo = 3; bar = 4}