Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This blog post accurately states the broken idea:

> Each is perfectly valid. Each behaves the same. It’s just a matter of preference and finding the style that makes most sense to you.

Part of being a good steward to a successful project is realizing that writing code for yourself is a Bad Idea™. If thousands of people are using your code, then write your code for maximum clarity, not your personal preference of how to get clever within the spec.

Code is harder to read than to write. To borrow a line from Jacob Kaplan-Moss, if I write the cleverest code that I am able to, then by definition I won't be able to understand it later.

This semicolon approach isn't invalid, but it is clearly a source of confusion, and it requires that users comprehend the choice and the tradeoffs. This seems like a poor choice for a framework whose audience is largely people who don't grok this stuff and are bolting it on wholesale.

<3 bootstrap, just my $0.02.



The quote is Kernighan's I think: "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."


It is a valuable and documented code quality. http://en.wikipedia.org/wiki/Principle_of_least_astonishment

Principle of least astonishment (POLA) was also a core design decision behind ruby. http://en.wikipedia.org/wiki/Ruby_(programming_language)#Phi...


Leaving semi-colons out is not clever, it's just understanding where you need them instead of shooting blindly.


Does it hurt to have extra semi-colons? Maybe you have some empty statements. Does it hurt to have too few? Well, if you either do not know what you're doing, or someone maintaining doesn't understand what you did, etc., then yes.


Extra semicolons can cause problems. If "someone who doesn't know what they're doing" starts putting semicolons after randomly chosen tokens, it will absolutely break your program. You need to understand statement boundaries whether or not you explicitly mark them with semicolons.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: