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

I think this guy might be confusing code with style. This is why I never ever let the interns not use braces. We built a style guide that is good at blocking these types of errors. Not to mention that Apple should have tested enough to catch that error... It is about the code, but maybe not in the way this guy thinks.


For this, you don't need a style guide, but a static code analysis tool. This specific error causes unreachable lines and has suspicious indentation.

In my project, that could could have never gotten into production, because the tools would have stopped us, even without a single unit tests.


Few languages that have copied their if statement from C have adopted C's exact syntax. Most, if not all, make the braces mandatory. It is a flaw in the language that it permits such a dangerous style.


Go and Rust make the braces mandatory. Hugely more popular curly-braces languages such as Java, Javascript, or C#, don't.


> This is why I never ever let the interns not use braces.

And hopefully nobody else either.

Beware the "experienced" developer who skips braces "because it's more elegant" or "because it's unnecessary typing".




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: