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

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

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

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


当前回答

我有一些…凡事都有例外,所以这些并不是一成不变的,但它们确实适用于大多数情况

没有人关心您的网站是否经过验证、是否严格遵守XHTML、是否符合标准或是否有W3C标记。

It may earn you some high-fives from fellow Web developers, but the rest of people looking at your site could give a crap whether you've validated your code or not. the vast majority of Web surfers are using IE or Firefox, and since both of those browsers are forgiving of nonstandards, nonstrict, invalidated HTML then you really dont need to worry about it. If you've built a site for a car dealer, a mechanic, a radio station, a church, or a local small business, how many people in any of those businesses' target demographics do you think care about valid HTML? I'd hazard a guess it's pretty close to 0.

大多数开源软件都是无用的、过于复杂的垃圾。

Let me install this nice piece of OSS I've found. It looks like it should do exactly what I want! Oh wait, first I have to install this other window manager thingy. OK. Then i need to get this command-line tool and add it to my path. Now I need the latest runtimes for X, Y, and Z. now i need to make sure i have these processes running. ok, great... its all configured. Now let me learn a whole new set of commands to use it. Oh cool, someone built a GUI for it. I guess I don't need to learn these commands. Wait, I need this library on here to get the GUI to work. Gotta download that now. ok, now its working...crap, I can't figure out this terrible UI.

sound familiar? OSS is full of complication for complication's sake, tricky installs that you need to be an expert to perform, and tools that most people wouldn't know what to do with anyway. So many projects fall by the wayside, others are so niche that very few people would use them, and some of the decent ones (FlowPlayer, OSCommerce, etc) have such ridiculously overcomplicated and bloated source code that it defeats the purpose of being able to edit the source. You can edit the source... if you can figure out which of the 400 files contains the code that needs modification. You're really in trouble when you learn that its all 400 of them.

其他回答

最好的程序员在调试器中跟踪所有代码并测试所有路径。

嗯…OP说有争议!

我通常持有相当有争议的、强烈的和响亮的观点,所以这里只是其中的一些:

“因为我们是微软的机构/合作伙伴/专家”从来都不是一个有效的论点。

我现在工作的公司首先把自己定位为微软专家。所以前面提到的论点被抛出了很多次,我还没有看到一个背景下它是有效的。

我不明白为什么要在每一个适用的角落推广微软的技术和产品,而不顾客户和员工的满意度,以及一般的实用主义。

这正是我对软件行业政治深恶痛绝的一个基石。

MOSS(微软Office Sharepoint服务器)就是一坨屎。

有点像第一个观点,但我真的认为MOSS应该被赶出市场。它需要花费大量的授权和设置费用,破坏了web标准,让开发者非常不开心。我还没有看到一个MOSS项目有一个总体积极的结果。

然而,一次又一次,客户找到我们并要求MOSS解决方案。

递归很有趣。

是的,我知道这可能是对堆栈空间的无效使用,诸如此类。但有时候递归算法比迭代算法更简洁。当我能把递归函数藏在某个地方时,我总是有点高兴。

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

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

c++是未来的杀手级语言…

... 动态语言。

没有人拥有它,它有越来越多的特性,比如编译时(元)编程或类型推断,没有函数调用开销的回调,不强制单一方法(多范式)。POSIX和ECMAScript正则表达式。多个返回值。你可以有命名参数。等等。

编程的过程非常缓慢。JavaScript花了10年的时间才起步(主要是因为性能),大多数用它编程的人仍然不理解它(JS中的类?来吧!)我敢说c++将在15-20年后真正开始发光。对我来说,这似乎是c++(语言以及编译器供应商)和当今使用动态语言编写的程序员的适当时间。

c++需要变得对程序员更加友好(编译器错误是由模板或编译时间生成的),程序员需要意识到静态类型是一个福音(它已经在进行中,参见这里断言用动态类型语言编写的好代码就像编写静态类型语言一样)。