This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

Linux.com

Re:GNOME - dependency hell / speed of OOP in C

Posted by: Anonymous Coward on February 20, 2007 11:21 PM
"Proper oop code of C is much faster than C++ will ever be."

That's a crock. The "C++ is bloated and slow" argument arose because earlier implementations of g++ were inefficient. There is no meaningful performance penalty anymore for using C++ rather than C.

"OOP in C" is really painful because the language isn't designed to do it. And yes, I do write C every day. I do use a lot of the objective-type design tactics in my C code (like using structs and "private" functions that only have file scope, while the "public" interface is provided through functions with global scope). However, it would be a lot cleaner to do this in a language that is designed with these features in mind. And as for writing C with inheritance or virtual functions, the techniques available are really ugly kludges.

Basically, if you want to do OOP, C is an unnatural choice of language, even though it is possible to force it to do it.

#

Return to Linus fires latest shot in GNOME Wars