4 ms·
I don't know if this will apply to you, but it's also possible to "see" the blocks just by indentation. If you assume that this is possible, and your eyes can
by inerte 15y ago
I don't know if this will apply to you, but it's also possible to "see" the blocks just by indentation.
If you assume that this is possible, and your eyes can get used to read code just by its blocking, then brackets are unnecessary, even superfluous.
- blueprint 15y agoCase in point http://coffeescript.org/ http://coffeescript.org/
- tomp 15y ago> it's also possible to "see" the blocks just by indentation. As long as there are not too many newlines within blocks...
- webjprgm 15y agoIt's like becoming bilingual. When you know only English other languages are completely confusing, but once you learn a second language you can more easily pick out pieces of others. If all you know is {}, then other code is harder to read. Once you learn either a Lisp-like language or a Python-like language then you learn to see code blocks without {}. This is what happened for me. (I was forced into learning Scheme in school. Only after that did I decide that Python was an OK language after all.)
- mindcrime 15y agoMeh... I've written both Python and C/C++/Java, and I disagree that it's possible to reach a point where the indentation completely obviates the need for brackets in identify blocks. That might be true if you always keep blocks extremely short, and if you never have more than a couple of levels of indentation, but in the real world code never quite seems to fit that Platonic ideal. I'll grant, however, that the Python approach isn't quite as bad as I thought it would be, and that it can come close to matching the readability of "code with braces." But, for me at least, braces (and vertically aligned ones at that, dangit) absolutely make code more readable. YMMV, IANAL, HTH, WTFBBQ, etc...