Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Linus: C++ is a horrible language (gmane.org)
45 points by tambourine_man on Nov 3, 2011 | hide | past | favorite | 20 comments


I tire of having this rant being posted every three months on HN.

Linus is just having a strong reaction, the rant is more than four years old, Linus says nothing interesting about C++ and the same could be said about so many languages that its sad.

Additionally, any post about "this language is teh suxxance" - even when written by someone worth of attention - is generally full of nothing and adds little value to a community.



Especially when both const and mutable exist in C++. ;)


Just to be clear "mutable" in C++ do not mean what I want it to mean. Actually, it makes things even worse.

Thanks for pointing out the ambiguity, though. I'll try and fix that (that won't be easy, "mutable" definitely is the best keyword for what I want to express).

(Yes, I wrote that article, and I am dead serious. This is also not a random rant. I wrote other articles to back that up: http://www.loup-vaillant.fr/articles/ Note that I don't attack any particular language here, but an entire class of them.)


Nothing in there that isn't true of other languages, C in fact. Can write crap in anything.

Usual rant from a newbie C++ developer.

The guy did marvelous things; his opinions about languages are not his expertise, and not worth wide discussion.


I have 20 years of experience in C++. C++ makes me more productive.

If I understand correctly, Linus is saying something I agree with: a bad programmer using C++ will write code that is harder to maintain than code written by a bad programmer using C.

Bjarne Stroustrup once said, "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off."

In his FAQ, he expands on this point: "What people tend to miss, is that what I said there about C++ is to a varying extent true for all powerful languages. As you protect people from simple dangers, they get themselves into new and less obvious problems. Someone who avoids the simple problems may simply be heading for a not-so-simple one. One problem with very supporting and protective environments is that the hard problems may be discovered too late or be too hard to remedy once discovered. Also, a rare problem is harder to find than a frequent one because you don't suspect it."

In my view, Linus is agreeing with BS.


The essence of the rant (which I agree with) is that it's not about the language, it's about the culture associated with it.

You can write horribly structured code in C, probably more easily than in C++. And some people do. But most C programmers read K&R at some point, or maybe even some Linux kernel code, and so they end up valuing a style that emphasizes clarity and simplicity.

If anything, the sheer easiness of shooting yourself with C puts on a Darwinian pressure that causes long-term C developers to either adopt this culture or switch to something else.


> On Wed, 5 Sep 2007, Dmitry Kakurin wrote:

At the very least Dmitry can now add to his resume that he is full of BS as per Linus Torvalds. I would've loved to have that on my resume if I were applying for the C jobs :)


Why? This wasn't meant as a compliment...


It makes the resume stand out in the crowd. I know I would've invited the guy in, especially if he'd presented Linus' assessment ironically. That's why he needs to apply for a C position for this to work the best :)


Every programming language is horrible, that's why programmers exist


God, I want a HN page that worked like Digg, where when you flag items they disappear, and you don't have to keep looking at them all day.


You might be interested in hn-zero, a chrome extension I wrote that makes articles on the HN homepage disappear after reading both the article and comments, or hitting a small X by the article.

https://github.com/ddgromit/hn-zero


the only way to do good, efficient, and system-level

That's the key restriction from Linus right there. He was talking about system-level code.

For everything else (application-level, frameworks, etc.), you need the abstractions that C++ provides.


For applications and frameworks, other languages provide the abstractions in a less difficult to wrangle fashion. Ada is perhaps my favorite example but you actually don't even have to leave the C family -- Objective-C is very pleasant to use in such a role. (No, it's not just an Apple thing, I use it all the time for Linux and cross-platform code.)


No one is going to accuse Linus of not having an opinion. Reminds me of his rant on SVN. This is pretty baseless though.


Link to the SVN rant?


By his logic you should just write everything in machine code and be done with it...


Wow. I don't think I've ever seen such a verbal smackdown from Torvalds himself.


He's famous for them, and delivers them with regularity. This is the guy that has said "your code is shit" on several occasions.

Linus is widely considered to be a nice guy, and he probably is. But make sure you've toughened your skin before posting to linux-kernel.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: