7 ms·
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 th
by usumoio 12y ago
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.
- jerf 12y agoFew 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.
- mercurial 12y agoGo and Rust make the braces mandatory. Hugely more popular curly-braces languages such as Java, Javascript, or C#, don't.
- hibikir 12y agoFor 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.
- Terr_ 12y ago> 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".