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

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

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

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


当前回答

真正有争议的:

你什么都不知道!

换句话说:

我知道我什么都不知道。

(这可以有很多种解释,但我认为你已经明白了。)

在开始计算机开发时,我认为每个人都必须经历三个阶段:

新手: 一无所知(这是事实)

中间: (这是自负)自以为知道些什么/非常多(/所有)

专业: 知道自己什么都不懂(因为作为一个程序员,大多数时候你必须处理你以前从未做过的事情)。 这不是坏事:我喜欢让自己随时熟悉新事物。

我认为作为一个程序员,你必须知道如何学习——或者更好:学会学习(因为记住:你什么都不知道!)))。

其他回答

理解“做什么”至少和知道“如何”做一样重要,而且总是比知道解决问题的“最佳”方法重要得多。领域特定的知识对于编写好的软件通常是至关重要的。

SESE (Single Entry Single Exit)不是法律

例子:

public int foo() {
   if( someCondition ) {
      return 0;
   }

   return -1;
}

vs:

public int foo() {
   int returnValue = -1;

   if( someCondition ) {
      returnValue = 0;
   }

   return returnValue;
}

我和我的团队发现,在很多情况下,一直遵守这一点实际上会适得其反。

缺陷和增强请求是相同的

Unless you are developing software on a fixed-price contract, there should be no difference when prioritizing your backlog between "bugs" and "enhancements" and "new feature" requests. OK - maybe that's not controversial, but I have worked on enterprise IT projects where the edict was that "all open bugs must be fixed in the next release", even if that left no developer time for the most desirable new features. So, a problem which was encountered by 1% of the users, 1% of the time took precedence over a new feature would might be immediately useful to 90% of the users. I like to take my entire project backlog, put estimates around each item and take it to the user community for prioritization - with items not classified as "defect", "enhancement", etc.

Web应用程序糟透了

我的网速很慢。我使用几乎所有不是谷歌的网站的经验至少是令人沮丧的。为什么现在没人写桌面应用了?哦,我明白了。没有人愿意学习操作系统是如何工作的。至少,不是Windows。上次你不得不处理WM_PAINT,你的头爆炸了。创建一个工作线程来执行一个长时间的任务(我的意思是,用Windows的方式来做)完全超出了你的能力。回调是什么鬼?哦,天哪!


垃圾收集糟透了

No, it actually doesn't. But it makes the programmers suck like nothing else. In college, the first language they taught us was Visual Basic (the original one). After that, there was another course where the teachers pretended they taught us C++. But the damage was done. Nobody actually knew how to use this esoteric keyword delete did. After testing our programs, we either got invalid address exceptions or memory leaks. Sometimes, we got both. Among the 1% of my faculty who can actually program, only one who can manage his memory by himself (at least, he pretends) and he's writing this rant. The rest write their programs in VB.NET, which, by definition, is a bad language.


动态类型糟糕透了

当然,除非您正在使用汇编程序(这是一种值得称赞的动态类型)。我的意思是动态解释性语言带来的开销让它们很糟糕。不要用不同的工具适合不同的工作这种愚蠢的论点。C语言是几乎所有事情的正确语言(它快速、强大、可移植),当它不是(它不够快)时,总有内联汇编。


我可能会提出更多的咆哮,但那将是以后,不是现在。

整天在Stackoverflow上回答问题的程序员可能并没有在做他们应该做的工作。