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

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

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

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


当前回答

如果你没有读过手册页,你就不是一个真正的程序员。

其他回答

I'd say that my most controversial opinion on programming is that I honestly believe you shouldn't worry so much about throw-away code and rewriting code. Too many times people feel that if you write something down, then changing it means you did something wrong. But the way my brain works is to get something very simple working, and update the code slowly, while ensuring that the code and the test continue to function together. It may end up actually creating classes, methods, additional parameters, etc., I fully well know will go away in a few hours. But I do it because i want to take only small steps toward my goal. In the end, I don't think I spend any more time using this technique than the programmers that stare at the screen trying to figure out the best design up front before writing a line of code.

我得到的好处是,我不必不断地处理那些因为我碰巧以某种方式破坏了它而不再工作的软件,并试图找出停止工作的原因和原因。

“邪恶”这个词在Stackoverflow和类似论坛上是一个被滥用和过度使用的词。

使用它的人想象力太少。

Python方法声明中的显式self是糟糕的设计选择。

方法调用有语法糖,但声明没有。这是一个有漏洞的抽象(故意的!),会导致令人讨厌的错误,包括运行时错误,在报告的参数数量中明显少了一个错误。

两行代码太多了。

如果一个方法有第二行代码,它就是代码气味。重构。

大多数咨询程序员都很糟糕,不应该被允许编写产品代码。

恕我冒昧,大概60%或更多