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

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

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

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


当前回答

软件架构师/设计人员被高估了

作为一名开发人员,我讨厌软件架构师这个概念。他们基本上不再全职编码,阅读杂志和文章,然后告诉你如何设计软件。只有那些真正以全职编写软件为生的人才应该这样做。我不在乎5年前你在成为架构师之前是不是世界上最好的程序员,你的观点对我来说毫无用处。

这有争议吗?

编辑(澄清一下):我认为大多数软件架构师都是出色的业务分析师(与客户交谈,编写需求,测试等),我只是认为他们在设计软件方面没有一席之地,无论是高级的还是其他的。

其他回答

goto有一些(非常少)合法的用途(特别是在C中,作为异常处理的替身)。

我可能会因此被炒,但是

在python中使不可见字符具有语法意义是一个坏主意

它会分散注意力,给新手带来很多微妙的bug,在我看来,这是不必要的。我所见过的唯一没有自愿遵循某种像样的格式指南的代码是来自计算机科学一年级的学生。即使代码不遵循“漂亮”的标准,也有很多工具可以将其转换成更令人满意的形状。

如果没有远程调试器,就无法编写web应用程序

Web应用程序通常将客户端和服务器端多种语言之间的交互联系在一起,需要用户进行交互,并且通常包括第三方代码,这些代码可以是简单的API实现,也可以是复杂的框架。

我已经记不清有多少次,当我用一个不错的远程调试器进入并跟踪一个复杂的web应用程序中实际发生的事情时,另一个开发人员坐在我身边,看到他们惊讶地发现有这样的工具存在。通常情况下,即使在看到这些工具的实际运行后,他们仍然不愿意费心安装和设置这些工具。

你只是不能用打印语句调试一个重要的web应用程序。如果应用程序中的所有代码都不正确,则乘以10。

如果您的调试器可以逐步检查所有正在使用的语言,并显示正在发生的http事务,那就更好了。

没有Firebug就无法开发web应用程序

同理,一旦你用过Firebug(或非常接近Firebug的东西),你就会对那些试图开发web应用程序的人既同情又恐惧。特别是Firebug显示计算样式,如果你还记得不使用它,花了几个小时随机更改各种CSS位,并添加“!重要的”在太多的地方搞笑你永远不会回去。

Java并不是最好的东西。仅仅因为它带有“企业”标签并不意味着它就好。也不会让它变快。也不是所有问题的答案。

另外,ROR并不是博客圈所吹嘘的那样。

当我在做的时候,OOP并不总是好的。事实上,我认为它通常是不好的。

您不应该停留在您发现的编写“有效”代码的第一种方法上。

I really don't think this should be controversial, but it is. People see an example from elsewhere in the code, from online, or from some old "Teach yourself Advanced Power SQLJava#BeansServer in 3.14159 minutes" book dated 1999, and they think they know something and they copy it into their code. They don't walk through the example to find out what each line does. They don't think about the design of their program and see if there might be a more organized or more natural way to do the same thing. They don't make any attempt at keeping their skill sets up to date to learn that they are using ideas and methods deprecated in the last year of the previous millenium. They don't seem to have the experience to learn that what they're copying has created specific horrific maintenance burdens for programmers for years and that they can be avoided with a little more thought.

事实上,他们似乎甚至没有意识到做一件事可能有不止一种方法。

I come from the Perl world, where one of the slogans is "There's More Than One Way To Do It." (TMTOWTDI) People who've taken a cursory look at Perl have written it off as "write-only" or "unreadable," largely because they've looked at crappy code written by people with the mindset I described above. Those people have given zero thought to design, maintainability, organization, reduction of duplication in code, coupling, cohesion, encapsulation, etc. They write crap. Those people exist programming in every language, and easy to learn languages with many ways to do things give them plenty of rope and guns to shoot and hang themselves with. Simultaneously.

But if you hang around the Perl world for longer than a cursory look, and watch what the long-timers in the community are doing, you see a remarkable thing: the good Perl programmers spend some time seeking to find the best way to do something. When they're naming a new module, they ask around for suggestions and bounce their ideas off of people. They hand their code out to get looked at, critiqued, and modified. If they have to do something nasty, they encapsulate it in the smallest way possible in a module for use in a more organized way. Several implementations of the same idea might hang around for awhile, but they compete for mindshare and marketshare, and they compete by trying to do the best job, and a big part of that is by making themselves easily maintainable. Really good Perl programmers seem to think hard about what they are doing and looking for the best way to do things, rather than just grabbing the first idea that flits through their brain.

如今,我主要在Java世界中编程。我见过一些非常好的Java代码,但我也见过很多垃圾代码,而且我还看到了更多我在开头描述的心态:人们选择了第一个看起来可以工作的丑陋代码块,而不理解它,也不考虑是否有更好的方法。

You will see both mindsets in every language. I'm not trying to impugn Java specifically. (Actually I really like it in some ways ... maybe that should be my real controversial opinion!) But I'm coming to believe that every programmer needs to spend a good couple of years with a TMTOWTDI-style language, because even though conventional wisdom has it that this leads to chaos and crappy code, it actually seems to produce people who understand that you need to think about the repercussions of what you are doing instead of trusting your language to have been designed to make you do the right thing with no effort.

我确实认为你可能会在另一个方向上走得太远:例如,完美主义完全忽略了你的真正需求和目标(通常是你的业务的真正需求和目标,通常是盈利能力)。但我不认为任何人都能成为一个真正伟大的程序员,除非学会投入一些高于平均水平的努力来思考寻找最好的(或至少是最好的一种)方法来编码他们正在做的事情。