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

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

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

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


当前回答

To Be A Good Programmer really requires working in multiple aspects of the field: Application development, Systems (Kernel) work, User Interface Design, Database, and so on. There are certain approaches common to all, and certain approaches that are specific to one aspect of the job. You need to learn how to program Java like a Java coder, not like a C++ coder and vice versa. User Interface design is really hard, and uses a different part of your brain than coding, but implementing that UI in code is yet another skill as well. It is not just that there is no "one" approach to coding, but there is not just one type of coding.

其他回答

管理者无所不知

根据我的经验,经理通常不是通过了解代码来达到这个目的的。不管你怎么跟他们说,它太长了,不对或者太贵了。

还有一个是继第一个之后的:

没有时间把事情做对,但总有时间再做一遍

一位很好的工程师朋友曾经说过,他很生气地描述了这样一种情况:管理层把他的估计减半了,从他那里得到了一个半途而废的版本,然后给了他两倍的时间来返工,因为它失败了。在商业软件世界中,这是一件相当常见的事情。

今天在尝试配置一个只有web接口的路由器时,我想到了一个问题:

网页界面是为傻瓜准备的

上一个固件版本的CLI非常好。这个版本有一个web界面,试图从无知的IT机器人那里隐藏所有网络的复杂性,甚至不能得到正确的vlan。

一旦发现缺陷就改正。不仅仅是“严重程度1”的缺陷;所有的缺陷。

建立一种部署机制,使用户可以立即使用应用程序更新,但允许他们选择何时接受这些更新。与用户建立直接的沟通机制,使他们能够报告缺陷,将他们的经验与更新联系起来,并提出改进建议。

With aggressive testing, many defects can be discovered during the iteration in which they are created; immediately correcting them reduces developer interrupts, a significant contributor to defect creation. Immediately correcting defects reported by users forges a constructive community, replacing product quality with product improvement as the main topic of conversation. Implementing user-suggested improvements that are consistent with your vision and strategy produces community of enthusiastic evangelists.

递归最糟糕的地方就是递归。

根据我得到的大量反馈,我最具争议的观点显然是,程序员并不总是读他们声称读过的书。这紧跟着我的观点,一个受过正规教育的程序员比一个自学成才的程序员更好(但不一定比另一个自学成才的程序员更好)。

观点:大多数代码都很糟糕,因为这是程序员想要的。

间接地,我们一直在培育一种极具创造力的文化。这并不是说我不认为解决问题具有创造性元素——它确实存在——只是它与绘画之类的事情根本不一样(参见保罗·格雷厄姆的著名文章《黑客和画家》)。

If we bend our industry towards that approach, ultimately it means letting every programmer go forth and whack out whatever highly creative, crazy stuff they want. Of course, for any sizable project, trying to put together dozens of unrelated, unstructured, unplanned bits into one final coherent bit won't work by definition. That's not a guess, or an estimate, it's the state of the industry that we face today. How many times have you seen sub-bits of functionality in a major program that were completely inconsistent with the rest of the code? It's so common now, it's a wonder anyone cause use any of these messes.

复杂,复杂,丑陋的东西只会变得更糟,更不稳定。如果我们正在建造一些实体的东西,地球上的每个人都会说我们的东西是多么丑陋和糟糕,但由于它或多或少被虚拟隐藏起来,我们能够逃脱一些我们物种所见过的最糟糕的制造过程。(你能想象一辆车有四个不同的人用四种不同的方式设计了四个不同的轮子吗?)

但可悲的是,这一切中有争议的部分是,绝对没有理由这样做,除了历史上的文化倾向于更多的自由和更少的组织,所以我们保持了这种方式(可能变得更糟)。软件开发是一个笑话,但它是一个笑话,因为这是程序员想要的(但永远不会承认这是真的,“管理层的阴谋”对大多数人来说是一个更好的理由)。

我们还会搬起石头砸自己的脚多久,才会幡然醒悟,意识到我们才是握着枪、指着枪、扣动扳机的人?

保罗。