semi-OT: source of quote?

R

Rui Maciel

I've recently stumbled on the following quote, supposedly attributed to Linus Thorvalds:

"The real problem with C++ for kernel modules is: the language just sucks."


I've searched for it's source but the only thing that I was able to get from google was a long list
of forum signatures which had that quote. So, does anyone know its source or is it yet another made
up quote?


Thanks in advance,
Rui Maciel
 
O

Oliver Jackson

I've recently stumbled on the following quote, supposedly attributed to Linus Thorvalds:

"The real problem with C++ for kernel modules is: the language just sucks.."

I've searched for it's source but the only thing that I was able to get from google was a long list
of forum signatures which had that quote.  So, does anyone know its source or is it yet another made
up quote?

Thanks in advance,
Rui Maciel

Hello, Rui.

I believe I have the answer you seek, which I will get to in a
moment. However, before I do so, I would like to offer this advice -
some stones are best left unturned. I can empathize with your hunger
for knowledge, but don't lose sight of our commonalities, lest you get
lost in the pursuit of answers.

OK, now that that is out of the way, here is your answer. The source
of the above quote is your mom.
 
F

Florian Weimer

* Rui Maciel:
I've recently stumbled on the following quote, supposedly attributed
to Linus Thorvalds:

"The real problem with C++ for kernel modules is: the language just sucks."

The closest quote is this:

| In fact, in Linux we did try C++ once already, back in 1992.
| It sucks. Trust me - writing kernel code in C++ is a BLOODY STUPID IDEA.

(Linus Torvalds, January 2004)
 
F

Francesco S. Carta

* Rui Maciel:


The closest quote is this:

| In fact, in Linux we did try C++ once already, back in 1992.
| It sucks. Trust me - writing kernel code in C++ is a BLOODY STUPID IDEA.

(Linus Torvalds, January 2004)

C++ has changed quite a bit in the 1992~2004 time frame...
 
R

Rui Maciel

Florian said:
The closest quote is this:

| In fact, in Linux we did try C++ once already, back in 1992.
| It sucks. Trust me - writing kernel code in C++ is a BLOODY STUPID IDEA.

(Linus Torvalds, January 2004)

Thanks for the help, Florian. Your quote does come close to it, except the "the language just
sucks" part. It appears to have been bolted on just to troll.

Here is a reference to the discussion where that quote popped out:
http://kerneltrap.org/node/2067


Once again thanks for the help, Florian.
Rui Maciel
 
R

Rui Maciel

Francesco said:
C++ has changed quite a bit in the 1992~2004 time frame...

Not to mention that once we look into it the quote really had nothing to do with C++.


Rui Maciel
 
B

Balog Pal

Florian Weimer said:
The closest quote is this:

| In fact, in Linux we did try C++ once already, back in 1992.
| It sucks. Trust me - writing kernel code in C++ is a BLOODY STUPID IDEA.

(Linus Torvalds, January 2004)

Maybe so, but there are ideas even more stupid. Like listening to that Linus
Torvalds offer to say, especially it it involves C++.

Certainly the statement is correct, if we beef it up with its environment.
C++ is a tool for the able people. It will suck miserably if tried by LT and
his surroundings.

Just do not extrapolate it.

(Interesting coincidence: at the very moment I write an extension for the
linux kernel. It must be done in C99, as C++ can't play. It can be done
certainly, but is a big pain in the ass. )
 
B

Balog Pal

Francesco S. Carta said:
C++ has changed quite a bit in the 1992~2004 time frame...

Sure, but the changes are not relevant for the work in kernel. Still the
ARM-level C++ could have been used for kernel to have more roboust and ways
better readable code.

The difference back in 92 was even more significant, having only C90, not
C99.
 
J

Johannes Schaub (litb)

Balog said:
Maybe so, but there are ideas even more stupid. Like listening to that
Linus Torvalds offer to say, especially it it involves C++.

Certainly the statement is correct, if we beef it up with its environment.
C++ is a tool for the able people. It will suck miserably if tried by LT
and his surroundings.

Just do not extrapolate it.

(Interesting coincidence: at the very moment I write an extension for the
linux kernel. It must be done in C99, as C++ can't play. It can be done
certainly, but is a big pain in the ass. )

I certainly agree with some of his opinions. The locale stuff in C++ is just
- hmm - useless. And the weird ways template mataprogramming is abused to
solve some problems it was never intended to is disgusting too.

Actually, i think he has a very good point. C++ is neither for highlevel
applications (no garbage collection), nor really good for lowlevel
applications (too much hidden costs - just take C instead). But i still like
it, because i'm a fanboi.
 
I

Ian Collins

Actually, i think he has a very good point. C++ is neither for highlevel
applications (no garbage collection), nor really good for lowlevel
applications (too much hidden costs - just take C instead). But i still like
it, because i'm a fanboi.

The hidden costs are a QoP (Quality of Programmer) issue, not a language
one!

Even a minimal subset of C++ is still better than C for drivers and
kernel modules.
 
R

Rui Maciel

Johannes said:
Actually, i think he has a very good point. C++ is neither for highlevel
applications (no garbage collection)

Why do you believe that garbage collection is important for the developing of high level
applications?


Rui Maciel
 
B

Balog Pal

Johannes Schaub (litb) said:
I certainly agree with some of his opinions. The locale stuff in C++ is
just
- hmm - useless. And the weird ways template mataprogramming is abused to
solve some problems it was never intended to is disgusting too.

His points may be agreed on in separation, but are bad in the context they
are stated. And stink badly too. You say locale stuff is bad? Well, it
is. Who is hurt by that? Those 3-4 providers of the standard lib. The
rest of the world just ignores the thing. What is it compartd to the
problem that std::string is bad? That sucks a ton of blood. Along with
other problems picked up from STL -- those that have widespread usage.

Disgusting TMP? Is there obligation to read the code? Boost works quite
well to the specification. The lack of core features much TMP struggles
to cover is indeed bad -- with pulling concepts a bunch of it remains
missing too. C++0x will help here and there though.

But we used C++ for much good ways before TMP was introduced. The
reference in the quite upward is '92? I recall Modern C++ Design and
pioneer articles around '98.
Actually, i think he has a very good point. C++ is neither for highlevel
applications (no garbage collection), nor really good for lowlevel
applications (too much hidden costs - just take C instead).

IMO that is pure bullshit.

I used C++ for both very high level things (creating libs/frameworks so the
"application" code could be matched to the specification directly. (and
NEVER needed GC for anything, RAII covered all my needs from the
beginning -- and anyone can easily install GC in need.

And used C++ for the lowest level too, writing embedded things.

Hidden costs? What that should be? The assembly code is exactly the same as
with the same functionality written in C. Or better.
But i still like it, because i'm a fanboi.

Shouldn't fanbois refrain from stating degrading comments that are not true?
;-)
 
J

Jorgen Grahn

Thanks for the help, Florian. Your quote does come close to it, except the
"the language just
sucks" part. It appears to have been bolted on just to troll.

Linus is a pretty good troll himself; the quote doesn't really
misrepresent him even if it's by someone else. He's fun when you
happen to agree with him, but not so much when you disagree.

Fortunately, he's not our boss.

/Jorgen
 
F

Francesco S. Carta

Not to mention that once we look into it the quote really had nothing to do with C++.

Both the purportedly true and the purportedly false quotes reported so
far in this thread decisively look like being about C++, what do you
mean exactly?
 
F

Francesco S. Carta

Sure, but the changes are not relevant for the work in kernel. Still the
ARM-level C++ could have been used for kernel to have more roboust and
ways better readable code.

The difference back in 92 was even more significant, having only C90,
not C99.

Yes, those are considerations that I didn't (and that I couldn't) make,
which seem to put the original quote in even a weirder light.
 
J

Juha Nieminen

Balog Pal said:
Maybe so, but there are ideas even more stupid. Like listening to that Linus
Torvalds offer to say, especially it it involves C++.

The major problem with Linus Torvalds is that he seems to talk (I assume
that he does so *deliberately* even though he probably knows better) about
the pre-standard C++ of the early 90's, as if all the alleged problems were
still relevant.

For example, his attitude towards the C++ standard library sounds a lot
like he was talking about pre-standard C++ compilers of the early 90's.
Before the language was officially standardized, it was indeed a risk to
use any non-C library which a given C++ compiler offered because there was
a high chance for the program to not to compile with another compiler.

Of course it took some time even after the language was officially
standardized for all major compilers to catch up and offer a full set
of standard libraries (eg. gcc 2.x was rather infamous for lacking many
relevant and useful standard library features, such as std::vector::at()).
However, the language was standardized over a decade ago, and those initial
problems are well in the past by now.

Another odd notion that he has is that he thinks that C, by its very
design, somehow naturally makes people write extremely efficient and
high-quality code, while C++ is the exact opposite: By its very design
it causes people to write extremely inefficient code.

You could make some arguments for the latter (especially when compared
to some higher-level languages), but the former is just incomprehensible.
I have seen quite a lot of horrible, horrible C code out there. So horrible
that it makes me want to rip my eyes out. That doesn't mean that writing
quality code is not possible in C. However, not only is his odd notion that
"C naturally leads to efficient and high-quality code" pure BS, but in my
experience C in fact easily induces horrible and inefficient code by its
very nature.
 
B

Bo Persson

Ian said:
The hidden costs are a QoP (Quality of Programmer) issue, not a
language one!

Even a minimal subset of C++ is still better than C for drivers and
kernel modules.

Yes, one of Linus' problems is that he has a hard time attracting good
C++ programmers to the kernel team. Wonder why?


Bo Persson
 
J

Jorgen Grahn

Yes, one of Linus' problems is that he has a hard time attracting good
C++ programmers to the kernel team. Wonder why?

Clearly that bothers Linus about as much as Miley Cyrus is worried
about her difficulties selling "Hannah Montana" records to norwegian
death metal fans ...

/Jorgen
 
R

Rui Maciel

Francesco said:
Both the purportedly true and the purportedly false quotes reported so
far in this thread decisively look like being about C++, what do you
mean exactly?

I was in the process of writing a reply to your post when I stumbled on yet another anti-C++ post by
linus torvalds himself. Here it goes:

http://lwn.net/Articles/249460/


While the previous post is debatable, as he complains essentially about compilers and goes on
claiming that it's possible to do OO programming in C, in this post he refers to C++.


Rui Maciel
 
R

Rui Maciel

Bo said:
Yes, one of Linus' problems is that he has a hard time attracting good
C++ programmers to the kernel team. Wonder why?

Why should he bother with that?


Rui Maciel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,200
Latest member
LaraHunley

Latest Threads

Top