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

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

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

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


当前回答

XML被高度高估了

我认为太多人在使用他们的大脑之前就开始了XML的潮流…… XML对于web来说是很棒的,因为它就是为它设计的。否则,我认为一些问题定义和设计思想应该优先于任何使用它的决定。

我的5美分

其他回答

软件复用是优化软件开发的重要途径

不知怎的,软件重用一度流行,但后来失去了它的魅力,因为许多公司发现,仅仅写带有重用口号的powerpoint演示文稿实际上并没有帮助。他们认为软件重用“不够好”,无法实现他们的梦想。因此,它似乎不再流行了——它被许多项目管理新手所取代(例如敏捷)。

事实是,任何真正优秀的开发人员都会自己执行某种软件重用。我会说任何不做软件重用的开发人员都是糟糕的开发人员!

我亲身经历过,软件重用在多大程度上可以提高开发的性能和稳定性。当然,一组幻灯片和管理层的半心半意的坦白并不足以在一家公司充分发挥其潜力。

我已经链接了一篇关于软件重用的旧文章(见标题)。它最初是用德语写的,后来被翻译了——所以,如果它写得不好,请原谅。

编码不是打字

编写代码需要时间。大多数时候,在编辑器窗口中,您只是查看代码,而不是实际输入。虽然不是经常,但你经常会删除你所写的内容。或者从一个地方搬到另一个地方。或重命名。

如果你长时间敲击键盘,那你一定做错了什么。

推论:每天写的代码行数并不是一个程序员生产力的线性衡量标准,一天写100行的程序员很可能比一天写20行的程序员更好,但一天写5000行的程序员肯定是坏程序员

Requirements analysis, specification, design, and documentation will almost never fit into a "template." You are 100% of the time better off by starting with a blank document and beginning to type with a view of "I will explain this in such a way that if I were dead and someone else read this document, they would know everything that I know and see and understand now" and then organizing from there, letting section headings and such develop naturally and fit the task you are specifying, rather than being constrained to some business or school's idea of what your document should look like. If you have to do a diagram, rather than using somebody's formal and incomprehensible system, you're often better off just drawing a diagram that makes sense, with a clear legend, which actually specifies the system you are trying to specify and communicates the information that the developer on the other end (often you, after a few years) needs to receive.

[如果有必要,一旦您编写了真正的文档,您通常可以把它塞进组织强加给您的任何模板中。不过,你可能会发现自己不得不添加章节标题和重复的材料。

The only time templates for these kinds of documents make sense is when you have a large number of tasks which are very similar in nature, differing only in details. "Write a program to allow single-use remote login access through this modem bank, driving the terminal connection nexus with C-Kermit," "Produce a historical trend and forecast report for capacity usage," "Use this library to give all reports the ability to be faxed," "Fix this code for the year 2000 problem," and "Add database triggers to this table to populate a software product provided for us by a third-party vendor" can not all be described by the same template, no matter what people may think. And for the record, the requirements and design diagramming techniques that my college classes attempted to teach me and my classmates could not be used to specify a simple calculator program (and everyone knew it).

I work in ASP.NET / VB.NET a lot and find ViewState an absolute nightmare. It's enabled by default on the majority of fields and causes a large quantity of encoded data at the start of every web page. The bigger a page gets in terms of controls on a page, the larger the ViewState data will become. Most people don't turn an eye to it, but it creates a large set of data which is usually irrelevant to the tasks being carried on the page. You must manually disable this option on all ASP controls if they're not being used. It's either that or have custom controls for everything.

在我使用的一些页面上,页面的一半是由ViewState组成的,这真的很遗憾,因为可能有更好的方法来做到这一点。

这只是我在语言/技术观点方面能想到的一个小例子。这可能会引起争议。

顺便说一下,你可能想在这个帖子上编辑投票,它可能会被一些人热得很;)

最好的代码通常不是你写的。作为程序员,我们希望通过编写一些很酷的方法来解决每个问题。任何时候,我们都能在解决问题的同时满足用户80%的需求,而无需引入更多代码进行维护和测试,我们已经提供了更多的价值。