Do you contribute to GCC?
The reality is that the inability to sanely represent concepts in C cleanly was a huge maintenance burden.
Yes, you can make OOP like stuff in C.
Yes, you can theoretically do anything you can do in C++.
But you only have to look at GCC to see what happens you do your best to simulate C++ concepts in C.
Yes, it's possible. Heck, I spent almost a year creating a sane structure hierarchy for the tree structures using the first member rule.
Compared to real classes and overloading, it's a joke.
But hey, rather than argue this point with me, you should just go and prove everyone wrong. Make GCC sane to maintain. Show us all how it's done. If you do that, i'll happily say you were right. Because a lot of smart people thought very hard about how to make GCC easier to maintain, and they are the ones that moved it to C++.
So if you are going to say they were wrong, please, prove it.
Posted Dec 24, 2012 4:20 UTC (Mon) by cmccabe (guest, #60281)
[Link]
I haven't contributed to gcc, except by bug reports.
However, I have worked with many C and C++ projects. In my experience, you CAN represent objects very cleanly in C-- the kernel is a good example. C++ has its advantages for certain applications, but it's far from a cure-all. It's kind of funny that on "Linux weekly news" people haven't read the opinions of the creator of Linux about C++.
GNU sed 4.2.2 released; maintainer resigns
Posted Dec 24, 2012 7:46 UTC (Mon) by boudewijn (subscriber, #14185)
[Link]
I have read those opinions, and dismissed them as more of the bigoted nonsense that Linus is apt to spout when he feels like flaming off a bit.
GNU sed 4.2.2 released; maintainer resigns
Posted Dec 24, 2012 15:05 UTC (Mon) by dberlin (subscriber, #24694)
[Link]
Of course i've read it, but what does that have to do with anything.
The kernel is not exactly the bastion of clean maintainable code, despite Linus's opinions.
Nobody complaining about C++ has yet come onto the GCC mailing list and explained, in clear concrete terms with examples, how they could make GCC more maintainable using C than it would be using C++.
Instead they sit on LWN and kibitz from afar.
GNU sed 4.2.2 released; maintainer resigns
Posted Dec 25, 2012 22:41 UTC (Tue) by HelloWorld (guest, #56129)
[Link]
> However, I have worked with many C and C++ projects. In my experience, you CAN represent objects very cleanly in C-- the kernel is a good example.
I disagree, the typical implementation of objects with vtables etc. is ugly in C, and manual implementations of advanced concepts like multiple and virtual inheritance are hard to use and maintain.
C++ also has a lot more to offer than OOP (esp. templates).