On 2017-04-26 09:59, Michal Kubecek wrote:
On Wednesday, 26 April 2017 9:20 Rüdiger Meier wrote:
Quoting Linus Torvalds: "C++ is a horrible language. It's made more horrible by the fact that a lot of substandard programmers use it, to the point where it's much much easier to generate total and utter crap with it. Quite frankly, even if the choice of C were to do *nothing* but keep the C++ programmers out, that in itself would be a huge reason to use C." http://harmful.cat-v.org/software/c++/linus
One should keep in mind that:
- Linus is not an ultimate source of Undisputable Truth; and even less so when he doesn't talk about kernel - most of the arguments he presents are in fact only valid for kernel development
Personally, I think that the Gtk's heavy use of what I call "poor man's polymorphism" is one of the most illustrative examples showing that there are projects where C++ makes much more sense than C.
Indeed, and the Linux kernel heavily uses the same so it would surely benefit from using C++ as well? Except by writing the object support yourself you can tune for the right tradeoff between overhead and abstraction level and ensure that the object system fulfills your requirements and expectations. One of them being it does not change API and ABI every other gcc release. So GTK made the same choice. Being low-level framework I think that is a fine choice and one of the few that I think GTK got right. With GTK you get the additional benefit that GTK applications can link with whatever libstdc++ they like when they use C++ themselves because GTK does not use any libstdc++ at all. Yay! Thanks Michal -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org