D - more power than (really) needed !

Hasan Aljudy hasan.aljudy at gmail.com
Sat Mar 11 15:39:17 PST 2006


David Medlock wrote:
<snip>
> see:
> http://okmij.org/ftp/Computation/Subtyping/#Problem
> 
> -DavidM

A nice example of not understanding OOP :)

WOW .. I think I'm beginning to understand what Schock means when he 
says everyone out there thinks they are doing object oriented 
programming, but only very few of them really are.

There's no "book" that you can follow literally to produce good code. 
It's a matter of trial and error. You try to subclass CSet from CBag, 
and disvocer that it doesn't work, or produce more problem than it 
solves, then don't whine about it, just implement CSet differently. It's 
not OOP's fault, nor is it inheritance's fault.
If you try to open a door with a screw-driver and it doesn't work, 
should you blame the screw-driver, or blame yourself for not 
understanding how doors work?

Apparently subclassing CSet from CBag wasn't such a good idea. Don't 
blame the object oriented paradigm for it. No where in the paradigm does 
it say that you should sublcass CSet from CBag!

Aside from that, the real clurpit here is C++, which allows you to deal 
with objects BY VALUE!! polymorhpism dies at that point.

And, really, C++ doesn't support OO, it just presents an awefully 
complicated set of features!!

I came to really hate C++ lately.



More information about the Digitalmars-d mailing list