|
|
Subscribe / Log in / New account

GCC begins move to C++

GCC begins move to C++

Posted Jun 1, 2010 3:27 UTC (Tue) by jrn (subscriber, #64214)
In reply to: GCC begins move to C++ by HelloWorld
Parent article: GCC begins move to C++

I don’t think Linus’s messages were meant to do much more than explain why core Git should stay in C, so the rebuttal seems a bit misdirected. But I could not resist mentioning a different problem: the mistake of not taking into account differences in idiom, which seems to be well described here: http://www2.research.att.com/~bs/bs_faq.html#compare

One of the merits of idiomatic C is that it is easy to guess roughly what is going to happen on the machine due to your code. I cannot imagine an experienced C programmer using

for (i = 0; i < strlen(line); i++)

except to prove a point, for exactly this reason.

Especially amusing was this:

> Unless countless very respected computer scientists and programmers around the world are completely wrong, we just cannot deny that non-abstract, low-level code tends to be quite unmaintainable. This is the more true the larger the program is.

> Torvalds not only admits here that C, by its very nature, leads you to create non-abstract, low-level code, that C gives you the mentality required to create such non-abstract code, but he actually claims that it's a good thing that this is so.

How does one explain the Linux kernel? Of course it includes abstraction where appropriate, just like most reasonably-sized C programs do.


to post comments

GCC begins move to C++

Posted Jun 2, 2010 18:35 UTC (Wed) by Cyberax (✭ supporter ✭, #52523) [Link] (4 responses)

"I cannot imagine an experienced C programmer using
for (i = 0; i < strlen(line); i++)
except to prove a point, for exactly this reason."

Nope, it's a great example. Because C programmers routinely use examples which no sane C++ developer will ever write to prove that C++ is BAD BAD BAD. Why shouldn't C++ developers do the same?

"How does one explain the Linux kernel? Of course it includes abstraction where appropriate, just like most reasonably-sized C programs do."

Linux is good because it's not actually quite that big. Most of code is in the drivers. And its infrastructure code if fairly compact and has quite clean abstractions.

GCC begins move to C++

Posted Jun 2, 2010 18:45 UTC (Wed) by ikm (guest, #493) [Link] (1 responses)

> Why shouldn't C++ developers do the same?

Maybe because they don't have a problem with C?

GCC begins move to C++

Posted Jun 2, 2010 18:47 UTC (Wed) by Cyberax (✭ supporter ✭, #52523) [Link]

That's a good point :)

GCC begins move to C++

Posted Jun 4, 2010 9:53 UTC (Fri) by jrn (subscriber, #64214) [Link] (1 responses)

> Because C programmers routinely use examples which no sane C++ developer will ever write to prove that C++ is BAD BAD BAD.

Good point. I get annoyed when C programmers do it, too. :)

GCC begins move to C++

Posted Jun 4, 2010 10:06 UTC (Fri) by dlang (guest, #313) [Link]

the problem is that there are so many insane developers around (in every language, I'm not picking on C++ here :)


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds