这绝对是主观的,但我想尽量避免它变成争论。我认为如果人们恰当地对待它,这将是一个有趣的问题。

这个问题的想法来自于我对“你最讨厌的语言的哪五件事?”问题的回答。我认为c#中的类在默认情况下应该是密封的——我不会把我的理由放在这个问题上,但我可能会写一个更完整的解释来回答这个问题。我对评论中的讨论热度感到惊讶(目前有25条评论)。

那么,你有什么有争议的观点?我宁愿避免那些基于相对较少的基础而导致相当宗教的事情(例如,大括号放置),但例如可能包括“单元测试实际上并没有多大帮助”或“公共字段确实是可以的”之类的事情。重要的是(至少对我来说)你的观点背后是有理由的。

请提出你的观点和理由——我鼓励人们投票给那些有充分论证和有趣的观点,不管你是否恰好同意这些观点。


当前回答

观点:永远不要在“调试”和“发布”版本之间有不同的代码

主要原因是发布代码几乎从未经过测试。最好让在测试中运行的代码与在野外运行的代码相同。

其他回答

每个开发人员都应该熟悉现代计算机的基本架构。这也适用于那些以虚拟机为目标的开发人员(可能更适用,因为他们已经被反复告知,他们不需要担心内存管理等)。

QA应该比开发人员更了解代码(间接地)。QA通过发现开发人员不希望发生的事情而获得报酬,他们经常这样做。(顺便说一句,我是一名非常看重优秀QA人员的开发者。很少)。

使用较短的变量名是可以的

但不是嵌套循环中的索引。

不应该允许非开发人员管理开发人员。

更正:没有开发经验的员工不应该被允许管理开发人员。

编写完代码后再编写规格说明。(如果有的话)

In many projects I have been involved in, a great deal of effort was spent at the outset writing a "spec" in Microsoft Word. This process culminated in a "sign off" meeting when the big shots bought in on the project, and after that meeting nobody ever looked at this document again. These documents are a complete waste of time and don't reflect how software is actually designed. This is not to say there are not other valuable artifacts of application design. They are usually contained on index cards, snapshots of whiteboards, cocktail napkins and other similar media that provide a kind of timeline for the app design. These are usually are the real specs of the app. If you are going to write a Word document, (and I am not particularly saying you should) do it at the end of the project. At least it will accurately represent what has been done in the code and might help someone down the road like the the QA team or the next version developers.