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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

What are the 7 deadly sins of programming?

3 点作者 elsadek超过 4 年前

2 条评论

Hackbraten超过 4 年前
&gt; <i>Hard-coding data.</i><p>I’m not convinced. Is the constant Pi not data? A multi-byte file magic? A constant matrix used for rotation?<p>&gt; <i>Put strings (like labels, messages, hints …etc ) directly in the code instead of externalizing them.</i><p>Many enterprise software projects are custom-built for a handful of users and don’t need externalization. Besides, log messages.<p>&gt; <i>Not using meaningful names for variables.</i><p>Strongly agree.<p>&gt; <i>Using name instead of verb in method&#x2F;function declaration.</i><p>What about getter methods? In some languages, `get` or `is` prefixes are not idiomatic.<p>&gt; <i>Rolling his own security</i><p>What is that even supposed to mean? Of course we roll our own security. It needs to be baked into the product from the design phase on.<p>What the author probably meant was: security algorithms. Maybe reflect on why they seem to assume all programmers are men.<p>&gt; <i>Jump staging right to the production.</i><p>What about ad-hoc debug helpers that sometimes have to be inserted while debugging in production?<p>&gt; <i>No comment !</i><p>Some pieces of code just don’t need comments.
bediger4000超过 4 年前
Why limit yourself to 7? There&#x27;s way more t han that.<p>This is analogous to &quot;The 10 Commandments of Programming&quot;, or &quot;of Java&quot; or &quot;of Visual Basic&quot;. Why limit yourself to 10? Why got all the way to 10 (remember 5 plus or minus 2)?