4 ms·
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 mak
by extension 15y ago
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.
- ansible 15y agoWhat 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 https://github.com/nathanaelkane/vim-indent-guides Screenshots at the bottom of the page.
- jholman 15y agocommenting to save for later (sorry)
- jtc331 15y ago/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.
- extension 15y agoYou'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.