TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Coding Guidelines

3 点作者 rttlesnke大约 12 年前

3 条评论

nate_martin大约 12 年前
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.
glitchdout大约 12 年前
&#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.
chidochidochido大约 12 年前
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)