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

Because bugs due to missing {} happen, and are a royal pain, the rule is that any nontrivial statement; especially any multi-line; must have braces.

Also, given the amount of patches I have to read, uniform style really does matter. Unconventional style breaks the flow and detracts from the important bits.

Also, I'm not aware of a lint like tool that works on diffs. Many of the patches never get further than my MUA.



I think you took my comment as sarcasm, but I quite agree with you; being able to leave out the curly braces was a mistake in the language design. Not as big as some of the others, but costly enough over all these decades.

Personally I prefer to be less strict about style whenever possible, but then I prefer to work in safer languages, and I don't have the same firehose to deal with.




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

Search: