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

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

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

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


当前回答

不是很有争议,但是… AJAX早在这个术语被创造出来之前就已经存在了,每个人都需要“放手”。人们用它做各种各样的事情。但是没有人真正关心它。

然后突然嘣!有人创造了这个术语,每个人都加入了AJAX的潮流。突然之间,人们成了AJAX的专家,好像动态加载数据的“专家”以前并不存在似的。我认为这是导致互联网被残酷摧毁的最大因素之一。还有“Web 2.0”。

其他回答

C(或c++)应该是第一种编程语言

第一语言不应该是简单的,它应该是建立学生的思想,为严肃的计算机科学做准备的语言。 C语言是完美的,它迫使学生考虑内存和所有低级别的东西,同时他们可以学习如何构造代码(它有函数!)

c++有一个额外的优势,它真的很糟糕:)这样学生就会明白为什么人们必须想出Java和c#

这不是关于编程的,因为html/css不是编程语言。

表格可以用于布局

CSS和div不能做所有的事情,节省你自己的麻烦,使用一个简单的表,然后在它上面使用CSS。

你需要提防对象痴迷的程序员。

例如,如果你写了一个类,对内置类型(如int或float)建模,你可能是一个迷恋对象的程序员。

c++是一门很好的语言

一两个星期前,我说c++不是一种很好的语言,在另一个问题上我几乎被私刑了。现在我试着反过来说。;)

不,认真地说,我当时想说的是,c++有很多缺陷,现在我还会再试一次。这一点很难否认。它是如此的复杂,以至于学好它实际上是一件你可以奉献一生的事情。它使许多常见的任务变得不必要的困难,允许用户一头扎进未定义的行为和不可移植的代码的海洋,而编译器没有给出警告。

但它并不是许多人试图创造的那种无用、破旧、过时、令人讨厌的语言。它不应该被掩盖和忽视。没有它,世界不会变得更好。它有一些独特的优势,不幸的是,隐藏在古怪的语法,遗留的麻烦,尤其是糟糕的c++老师背后。但是他们就在那里。

c++有许多我在用c#或其他“现代”语言编程时非常怀念的特性。其中有很多c#和其他现代语言可以学习的地方。

它并没有盲目地专注于OOP,而是探索并开创了泛型编程。它允许惊人地表达编译时元编程,生成极其高效、健壮和干净的代码。在c#出现LINQ或lambda表达式之前,它从函数式编程中吸取了近十年的经验教训。

它允许您通过静态断言和其他元编程技巧在编译时捕获数量惊人的错误,这极大地简化了调试,甚至在某些方面胜过单元测试。(我宁愿在编译时捕获错误,而不是在之后运行测试时捕获错误)。

变量的确定性销毁允许RAII,这是一个非常强大的小技巧,使try/finally块和c#使用块变得多余。

虽然有些人指责它是“由委员会设计的”,但我会说,是的,它是,在这种情况下,这实际上并不是一件坏事。看看Java的类库。又有多少类被弃用了?有多少不应该使用?有多少是相互复制的功能?有多少设计糟糕?

C++'s standard library is much smaller, but on the whole, it's remarkably well designed, and except for one or two minor warts (vector<bool>, for example), its design still holds up very well. When a feature is added to C++ or its standard library, it is subjected to heavy scrutiny. Couldn't Java have benefited from the same? .NET too, although it's younger and was somewhat better designed to begin with, is still accumulating a good handful of classes that are out of sync with reality, or were badly designed to begin with.

c++有很多其他语言无法比拟的优点。这是一门很好的语言

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

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.

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