GCC begins move to C++
GCC begins move to C++
Posted May 31, 2010 23:17 UTC (Mon) by HelloWorld (guest, #56129)In reply to: GCC begins move to C++ by Lovechild
Parent article: GCC begins move to C++
http://warp.povusers.org/OpenLetters/ResponseToTorvalds.html
Posted Jun 1, 2010 3:27 UTC (Tue)
by jrn (subscriber, #64214)
[Link] (5 responses)
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.
Posted Jun 2, 2010 18:35 UTC (Wed)
by Cyberax (✭ supporter ✭, #52523)
[Link] (4 responses)
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.
Posted Jun 2, 2010 18:45 UTC (Wed)
by ikm (guest, #493)
[Link] (1 responses)
Maybe because they don't have a problem with C?
Posted Jun 2, 2010 18:47 UTC (Wed)
by Cyberax (✭ supporter ✭, #52523)
[Link]
Posted Jun 4, 2010 9:53 UTC (Fri)
by jrn (subscriber, #64214)
[Link] (1 responses)
Good point. I get annoyed when C programmers do it, too. :)
Posted Jun 4, 2010 10:06 UTC (Fri)
by dlang (guest, #313)
[Link]
Posted Jun 1, 2010 3:54 UTC (Tue)
by jamesh (guest, #1159)
[Link] (1 responses)
For git, a minor contributor was proposing changes that would negatively affect the core developers' ability to maintain the code base (since C++ is not one of their areas of expertise). In the gcc case, it is the core developers themselves who are suggesting the change and believe it will make maintenance easier.
Posted Jun 1, 2010 6:30 UTC (Tue)
by adobriyan (subscriber, #30858)
[Link]
Proposing? I don't think so.
> When I first looked at Git source code two things struck me as odd:
Posted Jun 1, 2010 9:08 UTC (Tue)
by ctg (guest, #3459)
[Link] (1 responses)
1) Real Programmers use C
While I have some sympathy with the statements, I think it is largely a question of taste.
Posted Jun 1, 2010 9:22 UTC (Tue)
by ikm (guest, #493)
[Link]
Note the word 'tend'. This problem is not with the language, but with the monkey coders. How many C++ programmers actually understand how virtual functions are implemented, for instance?
With GCC, the answer would actually be "all of them" :)
The Linus' solution is just not to use C++ and do all the dirty work the compiler would've done for you yourself. I like the GCC's one -- to limit the allowed subset and to be careful and thoughtful -- MUCH better.
GCC begins move to C++
GCC begins move to C++
for (i = 0; i < strlen(line); i++)
except to prove a point, for exactly this reason."
GCC begins move to C++
GCC begins move to C++
GCC begins move to C++
GCC begins move to C++
GCC begins move to C++
GCC begins move to C++
> 1. Pure C as opposed to C++. No idea why. Please don't talk about
> portability, it's BS.
> 2. Brute-force, direct string manipulation. It's both verbose and
> error-prone. This makes it hard to follow high-level code logic.
GCC begins move to C++
2) C++ is about architecture, as much as code, and the architecture tends to be rigid. With C, you can ignore/change/adapt architectures within a project/timeframe.
GCC begins move to C++