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

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

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

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


当前回答

有一次,我从一位同事那里看到了以下内容:

compareto (b) == 0;

我说他不能在一般情况下这样假设,但他只是笑了。

其他回答

两个人的想法比一个人的好

我坚信结对编程是提高代码质量和编程效率的首要因素。不幸的是,对于那些认为“更多人手=>更多代码=> $$$!”

“一切都应该尽可能简单,但不能更简单。”——爱因斯坦。

人脑是开启所有锁的万能钥匙。

世界上没有任何东西能让你的大脑运转得更快。相信我,这不是哲学上的,而是实际的。就意见而言,他们就像下面一样


1)永远不要超出编程语言指定的界限,一个简单的例子就是C和c++中的指针。不要误用它们,因为你可能会得到该死的分割错误。

2)始终遵循编码标准,是的,你读的是正确的,编码标准对你的程序有很大的影响,毕竟你的程序是由机器执行的,但要被其他大脑理解:)

记录器配置是浪费时间。如果这意味着学习一种新的语法,尤其是一种无声地失败的语法,为什么要有它们呢?不要误解我,我喜欢好的伐木。我喜欢日志记录器的继承和向日志记录器的处理程序添加格式化程序。但是为什么要在配置文件中进行呢?

您希望在不重新编译的情况下对日志代码进行更改吗?为什么?如果您将日志代码放在单独的类、文件中,会有什么不同呢?

您是否希望将可配置的日志与您的产品一起分发给客户端?这不是提供了太多信息吗?

最令人沮丧的是,用流行语言编写的流行实用程序往往会按照该语言指定的格式编写良好的api。编写一个Java日志实用程序,我知道您已经生成了javadocs,我知道如何导航。为您的日志记录器配置编写一种特定于域的语言,我们有什么?也许有文件,但到底哪里去了?你来决定怎么组织,我对你的思路不感兴趣。

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

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.

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