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

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

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

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


当前回答

在1970年1月1日之前,真和假是相反的……

其他回答

低级语言不适用于大多数问题。

如果您的文本编辑器不能很好地完成代码,那么您就是在浪费每个人的时间。

Quickly remembering thousands of argument lists, spellings, and return values (not to mention class structures and similarly complex organizational patterns) is a task computers are good at and people (comparatively) are not. I buy wholeheartedly that slowing yourself down a bit and avoiding the gadget/feature cult is a great way to increase efficiency and avoid bugs, but there is simply no benefit to spending 30 seconds hunting unnecessarily through sourcecode or docs when you could spend nil... especially if you just need a spelling (which is more often than we like to admit).

当然,如果没有为您的语言提供这种功能的编辑器,或者任务简单到足以在加载更重的编辑器所需的时间内完成,那么没有人会告诉您Eclipse和90个插件是正确的工具。但是请不要告诉我,像1999年那样使用H-J-K-L的能力真的比每次需要方法签名时按escape键节省了更多时间……即使你觉得这样做不那么“黑客”了。

想法吗?

最新的设计模式往往是骗人的。正如之前在这个问题中所说的,过度使用设计模式对设计的危害远大于帮助。

如果我再听到一个人说“每个人都应该使用IOC”(或类似的废话),我想我将被迫找到他们,并告诉他们他们方法的错误。

未注释的代码是人类的祸害。

我认为注释对于代码是必要的。他们可视化地将其划分为逻辑部分,并在阅读代码时提供另一种表示方式。

文档注释是最低限度的,但是使用注释来分割较长的函数有助于编写新代码,并允许在返回现有代码时更快地分析。

一旦发现缺陷就改正。不仅仅是“严重程度1”的缺陷;所有的缺陷。

建立一种部署机制,使用户可以立即使用应用程序更新,但允许他们选择何时接受这些更新。与用户建立直接的沟通机制,使他们能够报告缺陷,将他们的经验与更新联系起来,并提出改进建议。

With aggressive testing, many defects can be discovered during the iteration in which they are created; immediately correcting them reduces developer interrupts, a significant contributor to defect creation. Immediately correcting defects reported by users forges a constructive community, replacing product quality with product improvement as the main topic of conversation. Implementing user-suggested improvements that are consistent with your vision and strategy produces community of enthusiastic evangelists.