Re:Making Coffeescript’s Whitespace More Significant
by extension on Wednesday November 30, 2011 @05:04PM
(#3297110)
Is counting delimiters any easier than measuring indentation? Not really. You will just fall back on the indentation in the end anyway. The delimiters never make anything clearer, they just help push the opening line off the top of the screen.
[ Parent
| on HN ]
Re:Making Coffeescript’s Whitespace More Significant
by ansible on Wednesday November 30, 2011 @06:06PM
(#3297306)
What we need are better editor setups that can slightly shade the backgrounds of nested blocks to clearly indicate indent levels and easily enable the programmer to see what matches to what.
Something like this for VIM:
https://github.com/nathanaelkane/vim-indent-guides
Screenshots at the bottom of the page.
Re:Making Coffeescript’s Whitespace More Significant
by jholman on Thursday December 01, 2011 @08:16PM
(#3302250)
commenting to save for later (sorry)
Re:Making Coffeescript’s Whitespace More Significant
by jtc331 on Wednesday November 30, 2011 @09:58PM
(#3298102)
/Counting/ delimiters isn't necessarily any easier for our brains than measuring indentation.
However, it is (at least for me) much easier for your eyes to line up two delimiters then a keyword/function call/literal/whatever and the end of the block it introduced when that block's termination is implicit from indentation. With the delimiters, I have two similar things to line up visually. With indentation-significant, I have to line up a delimiter with blank space, which is difficult.
Re:Making Coffeescript’s Whitespace More Significant
by extension on Thursday December 01, 2011 @12:07AM
(#3298458)
You're lining up the statement that opened the block with the statement that comes after the block. Should be easy.
And in the most common code style, delimiters don't line up anyway, because the opening delimiter is at the end of the line.