3 ms·
Easy solution. Just use coffeescript. Nice and clean, and you'll never have to see anyone, anywhere put comma's before lines. Win win :)
by nestlequ1k 15y ago
Easy solution. Just use coffeescript. Nice and clean, and you'll never have to see anyone, anywhere put comma's before lines.
Win win :)
- gcp 15y agoThe canonical indentation for CoffeeScript is 2 spaces. In a language that relies on indentation to define blocks...that's...insane. I can attest firsthand this causes bugs. 2 spaces just isn't enough to reliably visually identify the horizontal separation. Python got this right with PEP 8. CoffeeScript did not and is worse for it.
- tomjen3 15y agoThat is also the convention from Common Lisp, Scheme and (I believe) Ruby. As for it causing bugs, bugs are like cancer -- they are caused by everything.
- gcp 15y agoUh, Common Lisp and Scheme use parentheses for block delineation. How does someone on HN not know this? :-)
- nene 15y agoI've been switching between 2 and 4 spaces through my whole programming career. Even now I'm switching daily between different languages and projects with different amount of indentation. And I for one have noticed no correlation between bugs and amount of indentation. But I might be wrong - I have done no actual measurements. What I can say though, is that there is a correlation between a lousily indented code and bugs. Consistency is the key in indentation. Reading non-consistently indented code, that's what drives you insane... but two instead of four spaces... hardly.
- gcp 15y agoThis isn't about 2 spaces vs 4 spaces. It's about 2 spaces in a language where blocks are defined only by indentation. That's a HUGE difference. I have no problem with 2 spaces in C/C++. I have no problems with Pythons use of white-space to define blocks. But the combination is deadly.