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

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

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

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


当前回答

详细的设计是浪费时间,如果一个工程师需要它们来做一份体面的工作,那么就不值得雇佣它们!

好的,这里有几个想法:

1) the old idea of waterfall development where you supposedly did all your design up front, resulting in some glorified extremely detailed class diagrams, sequence diagrams etc. etc., was a complete waste of time. As I once said to a colleague, I'll be done with design once the code is finished. Which I think is what agile is partly a recognition of - that the code is the design, and that any decent developer is continually refactoring. This of course, makes the idea that your class diagrams are out of date laughable - they always will be.

2) management often thinks that you can usefully take a poor engineer and use them as a 'code monkey' - in other words they're not particularly talented, but heck - can't you use them to write some code. Well.. no! If you have to spend so much time writing detailed specs that you're basically specifying the code, then it will be quicker to write it yourself. You're not saving any time. If a developer isn't smart enough to use their own imagination and judgement they're not worth employing. (Note, I'm not talking about junior engineers who are able to learn. Plenty of 'senior engineers' fall into this category.)

其他回答

SQL可以而且应该做得更好。由于其原始规范有限,多年来各种厂商一直在向不同方向扩展该语言。为MS-SQL编写的SQL与为Oracle、IBM、MySQL、Sybase等编写的SQL不同。其他严肃的语言(以c++为例)都经过了仔细的标准化,因此在一个编译器下编写的c++通常可以在另一个编译器下编译而无需修改。为什么SQL不能被更好地设计和标准化呢?

HTML作为浏览器显示语言是一个严重的错误选择。我们花了数年时间通过CSS、XHTML、Javascript、Ajax、Flash等进行扩展,以制作一个可用的UI,但结果仍然不如你的基本厚客户端windows应用程序。此外,一个称职的web程序员现在需要了解三到四种语言才能制作一个像样的UI。

噢,是的。匈牙利符号令人厌恶。

软件开发人员、编码员、程序员、架构师之间没有区别……

我在酵母行业工作过10多种,但仍然觉得试图区分这些“角色”是绝对愚蠢的。你写代码?你是开发人员。你整天都在画漂亮的UML图。你是个…嗯. .我不知道你是谁,你可能只是想给别人留下好印象。(是的,我知道UML)。

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

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

匿名函数很糟糕。

我正在自学jQuery,虽然它是一种优雅且非常有用的技术,但大多数人似乎都将其视为最大化匿名函数用户的某种竞争。

函数和过程命名(以及变量命名)是我们在编程中所拥有的最强大的表达能力。将函数作为数据传递是一项伟大的技术,但使它们匿名并因此非自文档化是一个错误。这样就失去了表达代码含义的机会。

不要改变未坏的东西。