lies about OOP

Martijn Faassen faassen at infrae.com
Tue Dec 14 19:24:43 EST 2004


beliavsky at aol.com wrote:
> A paper finding that OOP can lead to more buggy software is at
> http://www.leshatton.org/IEEE_Soft_98a.html
[snip description of paper that compares C++ versus Pascal or C]
> 
> What papers have scientific evidence for OOP?

That's of course a good question. I'm sure also that comp.object has 
argued about this a thousand times. I'll just note that one paper is 
just a single data point with specific circumstances. The OO languages 
under investigation might have caused increased or lower failure rates 
for other reasons than their (lack of) object-orientedness, for 
instance. It is of course possible to come up with a lot of other 
explanations for a single data point besides a conclusion that OOP can 
lead to more buggy software. It for instance certainly not surprising to 
me that C++ can lead to more buggy software than some other languages. :)

[snip]
> If OOP is so beneficial for large projects, why are the Linux kernel,
> the interpreters for Perl and Python, and most compilers I know written
> in C rather than C++?

Because C++ is not an ideal object oriented language? Because a Linux 
kernel has very stringent predictability requirements for what kind of 
machine code is generated that C meets and is much harder to do with 
C++? There are other reasons to choose C, such as portability, obiquity 
and performance.

Some of the same reasons probably apply to Perl and Python, though at a 
lesser degrees. I do not know a lot about Perl's implementation. I do 
know that Guido van Rossum has in fact considered rewriting Python in 
C++ in the past. And right now, there are various projects that are 
using object oriented languages to reimplement Python, including Python 
itself.

Finally, it is certainly possible to program in object oriented style in 
C. It is more cumbersome than in a language that supports it natively, 
but it is certainly possible. Such OO in C patterns occur throughout the 
Linux kernel, which needs a pluggability architecture for its various 
types of drivers. It can also be seen in many aspects of Python's 
implementation. Another example of a C-based system that uses object 
oriented technologies is the GTK+ widget set.

Anyway, this question is using a few data points to make an overly 
generic argument, and the data points themselves do not really support 
the argument so very well either.

Regards,

Martijn



More information about the Python-list mailing list