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

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

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

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


当前回答

懒惰的程序员是最好的程序员

懒惰的程序员通常会找到方法来减少花在写代码上的时间(尤其是大量相似或重复的代码)。这通常转化为公司/团队中的其他开发人员可以从中受益的工具和工作流。

当开发人员遇到类似的项目时,他可能会创建工具来引导开发过程(例如,创建一个与公司的数据库设计范例一起工作的DRM层)。

此外,诸如此类的开发人员经常使用某种形式的代码生成。这意味着同一类型的所有错误(例如,代码生成器没有检查所有方法上的空参数)通常可以通过修复生成器来修复,而不是修复该错误的50多个实例。

一个懒惰的程序员可能会多花几个小时来完成第一个产品,但会为你节省几个月的时间。

其他回答

两个人的想法比一个人的好

我坚信结对编程是提高代码质量和编程效率的首要因素。不幸的是,对于那些认为“更多人手=>更多代码=> $$$!”

我相信Python的禅意

“一切都应该尽可能简单,但不能更简单。”——爱因斯坦。

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

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.

为了生产优秀的软件,你需要领域专家和优秀的开发人员一样多。