347 Comments
- agony, on 10/15/2007, -12/+160another episode of "I am Linus and hate everything"
- Roger, on 10/20/2007, -7/+132Linus codes a kernel for a living, so its not that surprising that he hates C++.
I'm sure lots of assembly code programmers hate C too. - corevette, on 10/15/2007, -8/+123pfff duh
linus hates everything except for linux, git, and kde - trogdoor, on 10/12/2007, -1/+71You must not pay much attention to Linus :)
- inactive, on 10/12/2007, -43/+93Linus is an *****, he lives here in Beaverton and the man has a big ego for someone nobody outside of the Linux community cares about.
- TennisElbow, on 10/17/2007, -49/+92I'm with Linus. C++ sucks. VB.NET all the way!
- Roger, on 10/10/2007, -5/+47He should hate KDE and QT too since they're both written in C++.
- GrassrootsNinja, on 10/10/2007, -3/+44Can anyone verify this? Linus sounds pretty angry...
- arunforce, on 10/12/2007, -44/+85Ok... Who cares if Linus Torvalds hates C++.
I don't really give a damn. - mortigon, on 10/17/2007, -17/+57But, we need C++ to write programs to figure out the square footage of a room, or to figure out the sales tax on a series of numbers that the person enters in a command prompt.
oh man I hope my teacher doesn't try to enter a letter. - geminitojanus, on 10/20/2007, -12/+51No he doesn't, he's just a jackass. Even when he has perfectly valid points, he's gotta put an ***** spin on it. In a way, it's a good thing; it polarizes the community and makes them passionate, but it's also a very bad thing because of the flamewars it often starts.
- jackyyll, on 10/20/2007, -4/+40Just shows he is a true geek, for all geeks are arrogant. It's the law.
- ReaperUnreal, on 10/10/2007, -24/+59In other news, Linus Torvalds doesn't understand Object-Oriented Programming.
- brokerer, on 10/10/2007, -6/+41funny that linus prefers kde when it is programmed in C++
- deadowl, on 10/17/2007, -2/+33Well, it's fairly easy to verify any email that goes out on a mailing list, so here you go:
http://thread.gmane.org/gmane.comp.version-control ...
Anyways, I prefer C++ in the sense that I can better represent mental models, but Torvalds has good points. I'm more concerned about the efficiency and whether a programmer that works on my program after I do will be able to understand it. As for the STL... like most standard libraries, it often tacks on a lot of things that you simply aren't going to use, and inevitably, it weighs down efficiency a bit (seriously, why use a string when all you're going to use it for is for var.length()). Still, there are a lot of companies that are less interested in the future cost to application efficiency and more worried about how much they're paying the programmer and the money they're losing by not releasing the software. Because of this, a lot of programmers are insensitive to making things as efficient as possible (especially Java programmers). - ahirreddy, on 11/02/2007, -5/+33Linus is saying that C++ is bad not because of the "language" but because of the implications of using it. He's saying that a lot of substandard programmers use C++ and depend upon inefficient libraries. The lack of such libraries in C keeps these bad programmers out, so he considers it an advantage to use C. Also programmers who use C++ get into the mind set that abstraction is better, and not until later down the road do they realize that they could have made everything much more efficient had they made the program simpler. He's saying that if you strip out all of the crap in C++, you essentially have C, so there's no point in going to C++.
Or at least that's what I got out of the article. - eepman, on 10/10/2007, -3/+31The URL says this article is Linux_Torvalds_hates_C and I was like wtf?
- geminitojanus, on 10/10/2007, -0/+28As an assembler by trade, I adore C. It more-or-less does my job for me most of the time, and it's much easier to write almost everything I want to do in C, compile it, and start optimizing the compiled output by hand. C is also not machine dependent, so if I need to run roughly the same code on a bunch of platforms, I can write it once in C, compile it for those platforms and tune from there.
- cranium, on 10/10/2007, -3/+29Wow, this is really going to piss off the C++ fundamentalists.
Actually, I think it's important to choose the right language for your problem space. I've been coding for 29 years now, from my experience .asm .c .cpp .cs .java, even friggin .pl all have their place. Linus has a point in that I can tell a lot about a programmer from the identity of their favorite language, but the fact is I wouldn't look down on them, I'd just know which projects they'd be better than others at creating. - MioTheGreat, on 10/10/2007, -5/+31To be fair, VB.NET is just C# with that disgusting BASIC syntax....so It's not that bad....
- Tishiablo, on 10/10/2007, -6/+30oh gawd...
- frase, on 10/17/2007, -10/+34LOL. A good read!
- rocket777, on 10/10/2007, -12/+35It's not that C++ is so bad, it's all the stupid things that programmers do with it that are bad. Like MS and their 20 levels of inheritance in a totally incomprehensible class library. Java is the same. Every class taught in OOP courses shows a class of mammals with a few things like dogs and cats. While that can be understood, once you start creating all these levels upon levels you have what used to be called spaghetti code, now it's more like piles and piles of crap.
As an example of what programming ought to be like, take a look at the GUI programming that the Tcl/Tk language (and perl/tk, also python/tk - all the same GUI library, I believe) then you will see what a programming language ought to be like.
pack [checkbutton .mybox -variable mybox -label "check if this is easy"]
set mybox 1
This creates a check button widget, and associates a variable with that checkmark. If you check it, then the variable is set to true; clear it and the variable is cleared to 0. If you set the variable, the checkmark appears.
This is 2 lines of code. In C++ or Java, or any of these other languages, you would need to study for months and then write dozens of lines of code to do this. Why? Because the writers of OOP want to use every trick in the language because they are in love with the language. They don't see the whole thing as newcomers do, and so they make a mess.
The STL is the biggest piece of crap I've seen in 40 years of programming. It's a graduate students project to prove one can write a totally orthogonal, yet totally inefficient, impossible to maintain, piece of crud. If you want a linked list, every element that goes into or out of the list is created and memory is allocated. I once stepped through a simple insert and it was 1000's of instructions. No wonder we have such horrible programs written today. And just try to create a list of objects other than simple things, and you need to write constructors and a ton of other stuff. I could go on and on...
The above - cbuddha42, on 10/10/2007, -3/+26He pretty much always does.
Doesn't mean his points aren't based on some kernel of truth though. He just always presents his opinions as facts, and he's often a dick to anyone who disagrees with him. - Cl1mh4224rd, on 10/10/2007, -11/+33He's definitely being one. He's acting as if C magically prevents horrible code. That's grade-A *****.
I generally refuse to read anything Linus says, not because he's wrong (although he most definitely is in this case), but because he's a dick. - geminitojanus, on 10/10/2007, -2/+23He doesn't judge the toolkit by the language its written on, he judges it based on what it does for him. His major criticisms of GNOME have always been how limited GNOME's configuration abilities have been.
- Samji, on 10/10/2007, -2/+21A simple "No, because I don't like how C++ wraps you into an object-model paradigm" would have been sufficient. Damn that guy really pissed him off for no reason at all.
- TheRemoteViewer, on 10/10/2007, -7/+26Why does he care? By his own admission he spends more time managing submissions than writing any code himself.
- TheSwashbuckler, on 10/10/2007, -5/+23He's always got a burr up his butt.
He's sorta right in that a lot of programmers can't write decent C++ code. But that's because they never learned OO, so they write C++ code like it was C code. - rhyss, on 10/10/2007, -3/+21LOGO forever! Go turtle, go turtle!
- Roger, on 10/10/2007, -1/+19"As an assembler by trade"
Translating all those opcodes into binary must get pretty tedious :)
Sounds more like you're just a C programmer who optimizes assembly code. - geminitojanus, on 10/10/2007, -1/+19Assembler just sounds so much cooler though ;)
- Ademan, on 10/20/2007, -5/+22Linus said himself he likes to make strong statements, generally stronger than he actually feels. Many many people hate c++, and that's their decision, i, for one love the language like a deformed child, or something like that. I think it does a lot of things right, but in the end, programming is ALWAYS about using the right tool for the right job, and to be honest, the right tool usually isn't c++.
- gkzhang, on 10/10/2007, -1/+18Just to clarify, C++ isn't really an Object Oriented Language. It's more of a language with Object Oriented functionality.
- 0xbaadf00d, on 10/10/2007, -3/+19Hey, VB.NET has its place. It's exactly equivalent with C# in power and functionality. Personally, I like C++. Pointers are just great.
- Kaosu, on 10/10/2007, -0/+16Great job missing the joke, genius.
- bradwich, on 10/10/2007, -5/+19Linus is incredibly smart, and I think most people who know anything about programming would probably agree. Having said that, he is also incredibly opinionated and incredibly vocal when he doesn't like something. Sometimes things really stink, and sometimes he just doesn't like them, but to him there is no difference between the two.
Linus starting the kernel in C years ago when he was still a university student. Since that time the kernel is basically all he's done. I really don't think Linus has spent a significant amount of time programming anything in C++. While he is a smart guy, in this instance he is just like a lot of other people who knock C++ when they don't really know the language. And yes, it is much more than C with classes. So, take his opinion with a grain of salt. - geminitojanus, on 10/10/2007, -1/+15"seriously, why use a string when all you're going to use it for is for var.length()"
String handling and lambda functions are the biggest things I miss while coding in C, to be truthful. So many buffer problems are caused by C programmers because the language never defined a high-level string handling system, and lambda functions are just a great way to speed up coding (especially for throw-away code). - gkzhang, on 10/10/2007, -0/+14perl is the mother of practical jokes!
- sekhui, on 10/10/2007, -0/+13i, too, can see the writing on the wall. if linus doesn't like c++ i can't either. i guess i'll go learn something else.
- inactive, on 10/10/2007, -2/+15Why does he care? You just said it. If all he did was write code, he wouldn't mind, but the problem that he describes is that C++ code is unmanageable , leads to problems down the road, and attracts poor programmers. These are the kinds of things that a manager like Linus cares about.
- purpmint008, on 10/10/2007, -5/+18OSS or Proprietary Software, there are ***** everywhere.
C++ is amazing in the hands of a professional. - catskul, on 10/10/2007, -2/+14I have to disagree. I resisted STL for a long time, but when I finally gave in I realized that when used correctly, they are enormously powerful. There certainly is room to shoot yourself in the foot, and the error messages they produce are crap, but after all is said and done, worth the hassle.
- geminitojanus, on 10/10/2007, -0/+12Well, for one your language is interpreted; Interpreted code just removes a lot of the explicit and makes it implicit, which some programmers see as being very nasty (especially if those implicit assumptions in the programmer's mind are different than reality). A big example of this is how many programmers screw up malloc() across platforms; on some platforms, it returns NULL when it can't allocate anymore, in others it will never return NULL. (for example, on platforms with memory management). This makes some programmers forget to check what malloc returns, which can be extremely nasty when proliferated.
As for your crude example, depending on the toolkit, you can do something like this rather cheaply. In GTK+ as a quick example:
GtkWidget* mybox = gtk_check_button_new_with_label("Check if this is easy");
gtk_widget_show(mybox);
So you might want to rethink what you're trying to say a little. - sekhui, on 10/10/2007, -1/+13you keep making spambots, and we'll keep on reporting them. deal?
- loboforestal, on 10/10/2007, -5/+16People, Linus codes operating systems. Operating systems are written in C. Something that doesn't consistently compile to code that runs at least 80% of the speed of hand crafted assembly is just not good enough in his world. The compiler not doing big and hidden "favors" for you is also a big plus. For Linus, C++ does suck.
- chall2001, on 10/10/2007, -5/+16I always figured C++ was a practical joke.
http://artlung.com/smorgasborg/Invention_of_Cplusp ... - kinghajj, on 10/10/2007, -4/+15C++ isn't the best example of an object-oriented language. It's very, very messy, and code in it looks god awful. Objective-C looks better, but the [] syntax is just weird. Java has a nice syntax, but is verbose.
- bnolsen, on 10/10/2007, -0/+11STL made some bad choices, ESPECIALLY the streams implementation.
However, the underlying std::streambuf stuff is actually really, really good.
The STL collections are over engineered, they over generalized them to an extreme.
The STL algorithms I think are the most useful part. They adapt very nicely to your own home cooked collections and are very powerful.
Inheritance should only be used for abstracting resources (it's nice to be able to not have to worry if you have a FILE* or a memory buffer!) and for enforcing an API around resources (ie, reading pngs vs jpegs vs tifs). Objects as structs are useful for documenting the code.
C++ really needs a lot of experience and a lot of care taken to just not use many of the features. The syntax especially of templates is very cumbersome if not downright annoying at times. However, there's no way I could use 'c' an keep my sanity.
I've bitched high and wide about crappy 'c' code people write. I think bad programmers write bad code in any language. - xirtap, on 10/10/2007, -5/+16Sounds like someone is getting old and bitter.
-
Show 51 - 100 of 345 discussions



What is Digg?
Digg is coming to a city (and computer) near you! Check out all the details on our