Hacker News new | past | comments | ask | show | jobs | submit login

I can somewhat forgive C for picking a syntax that turned out to be a bad idea. (Even if possibly some prior programming language made a better choice.) Java, on the other hand, copied that syntax knowing exactly how many bugs this would result in, for the questionable benefit that Java superficially looks a little bit more like C.



Even then there was a better way to do it. E.g. C# copied the C switch/case/break also, but with a caveat that all branches had to terminate without falling through. So you have to put a break there (or a return, or a goto, or a throw - basically any statement for which the compiler knows the control flow won't get past it).

And in rare cases where you do want fallthrough, they added the ability to "goto case" from the body of one case label to another. Which is kinda nice, because it follows the original C design in treating case labels as, well, labels.


That questionable benefit is what makes many developers adopt or not a language, and the main reason why we had to endure for so long the fashion of curly braces languages.

Thankfully this is changing now, with Pascal and ML syntax becoming again fashionable.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: