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

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

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

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


当前回答

在编程中使用的进程越多,代码就会变得越糟糕

I have noticed something in my 8 or so years of programming, and it seems ridiculous. It's that the only way to get quality is to employ quality developers, and remove as much process and formality from them as you can. Unit testing, coding standards, code/peer reviews, etc only reduce quality, not increase it. It sounds crazy, because the opposite should be true (more unit testing should lead to better code, great coding standards should lead to more readable code, code reviews should improve the quality of code) but it's not.

我认为这可以归结为我们称之为“软件工程”的事实,而实际上它是设计而不是工程。


以下数字可以证实这一说法:

From the Editor IEEE Software, November/December 2001 Quantifying Soft Factors by Steve McConnell ... Limited Importance of Process Maturity ... In comparing medium-size projects (100,000 lines of code), the one with the worst process will require 1.43 times as much effort as the one with the best process, all other things being equal. In other words, the maximum influence of process maturity on a project’s productivity is 1.43. ... ... What Clark doesn’t emphasize is that for a program of 100,000 lines of code, several human-oriented factors influence productivity more than process does. ... ... The seniority-oriented factors alone (AEXP, LTEX, PEXP) exert an influence of 3.02. The seven personnel-oriented factors collectively (ACAP, AEXP, LTEX, PCAP, PCON, PEXP, and SITE §) exert a staggering influence range of 25.8! This simple fact accounts for much of the reason that non-process-oriented organizations such as Microsoft, Amazon.com, and other entrepreneurial powerhouses can experience industry-leading productivity while seemingly shortchanging process. ... The Bottom Line ... It turns out that trading process sophistication for staff continuity, business domain experience, private offices, and other human-oriented factors is a sound economic tradeoff. Of course, the best organizations achieve high motivation and process sophistication at the same time, and that is the key challenge for any leading software organization.

请阅读文章,了解这些首字母缩写词的解释。

其他回答

意见:在开发领域的持续时间并不总是等同于经验。

许多行业看重一门语言的“多年经验”。是的,5年的c#学习是有意义的,因为你可能会学到新的技巧。然而,如果你在公司工作并维护相同的代码库很多年,我觉得作为一个在不同情况和客户需求下工作的人,你似乎没有获得足够的接触不同情况的机会。

I once interviewed a person who prided himself on having 10 years of programming experience and worked with VB5, 6, and VB.Net...all in the same company during that time. After more probing, I found out that while he worked with all of those versions of VB, he was only upgrading and constantly maintaining his original VB5 app. Never modified the architecture and let the upgrade wizards do their thing. I have interviewed people who only have 2 years in the field but have worked on multiple projects that have more "experience" than him.

编程还处于初级阶段。

尽管编程语言和方法已经发展了很多年,但我们还有很长的路要走。迹象很明显:

语言文档在互联网上随意传播(stackoverflow在这里有所帮助)。 语言在语法上的进化必然会破坏之前的版本。 调试仍然经常使用printf完成。 语言库或其他形式的大规模代码重用仍然相当罕见。

显然,所有这些都在改善,但如果我们都能同意这是开始而不是结束就好了=)。

分页从来不是用户想要的

If you start having the discussion about where to do pagination, in the database, in the business logic, on the client, etc. then you are asking the wrong question. If your app is giving back more data than the user needs, figure out a way for the user to narrow down what they need based on real criteria, not arbitrary sized chunks. And if the user really does want all those results, then give them all the results. Who are you helping by giving back 20 at a time? The server? Is that more important than your user?

[编辑:基于评论的澄清]

作为一个真实世界的例子,让我们看看这个Stack Overflow问题。假设我有一个有争议的编程观点。在我发帖之前,我想看看是否已经有了一个解决相同观点的答案,这样我就可以给它投票了。我唯一的选择就是点击每一页的答案。

我更喜欢以下选择之一:

请允许我搜索答案(这是一种根据实际标准缩小我需要的范围的方法)。 允许我看到所有的答案,这样我就可以使用浏览器的“查找”选项(给我所有的结果)。

如果我只是想找到以前读过的答案,但再也找不到了,也可以这样做。我不知道它是什么时候发布的,也不知道它有多少选票,所以排序选项没有帮助。即使我找到了,我仍然需要玩猜谜游戏来找到正确的结果页面。事实上,答案是有页码的,我可以直接点击进入十几个页面中的一个,这一点帮助都没有。

-- bmb

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

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

Java是我们这一代的COBOL语言。

每个人都要学会编码。在大公司中有运行它的代码,这些公司会试图让它运行几十年。与所有其他选择相比,每个人都开始鄙视它,但无论如何都被迫使用它,因为它可以支付账单。