TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Coding Guidelines

3 pointsby rttlesnkeabout 12 years ago

3 comments

nate_martinabout 12 years ago
Not sure if I agree with the section about curly braces being vertically aligned. I have seen production code with both and it honestly comes down to personal preference. If you think about aligning the start of the function/if with the closing curly brace it kind of has the same effect as stacking the curly braces.
glitchdoutabout 12 years ago
&#62; When using a constant in a comparison expression, always place the constant on the left side of the comparison operator.<p>So, Yoda conditions, hm? I disagree on this one, your compiler should give you a warning about it.<p>But it doesn't matter, really. Guidelines themselves don't matter much. What matters is having them and sticking to them.
chidochidochidoabout 12 years ago
Do you use any static analysis tool to verify these rules? For example, in the company that I work for we use MISRA C along with PC-lint (with some MISRA add-ons)