static and protection

Hasan Aljudy hasan.aljudy at gmail.com
Fri Mar 3 13:30:49 PST 2006


Don Clugston wrote:
<snip>
> I think that pure OO has largely been a failure. It's failed to live up 
> to its initial hype. (Specifically, the claim of code reuse has _not a 
> scrap_ of truth to it. History has shown that the only time you get code 
> reuse is when you intentionally design a library. C has a better history 
> of code reuse than object-oriented C++!). What _is_ true is that 
> cohesion leads to more reliable code.

I don't recognize "information hiding" and "code reuse" as 
benefits/goals of object oriented programming!!
Similarily, I don't recognize "platform independence" as a pwoerful 
advantage for Java!!

The reason I like and use Java is not the "compile-once-run-anywhere" 
motto. I like Java because it's simple yet powerful, and has a rich 
library/framework. (The downside is the VM)

Sometimes people promote the right thing for the wrong reason! you know ..

I'm a (self proclaimed) proponent of OOP because of concepts like 
cohesion and modularity, which highly reduce complexity, and allow 
easier maintainance of code.

"code reuse" is only true within the project itself! That is, if I want 
to implement two modules that have similar "functionalities", I put the 
"shared" functionality in a super class and then extend it.
Others will probably not find my superclass very usefull at all!


> 
> On a tangentially related topic:
> Something I'm finding very interesting about D is inner functions.
> I'm finding that lots of things I would have used private class members 
> for, I'm now using nested functions instead, with the result that simple 
> classes sometimes disappear completely.
> 
> With nested functions, you get extremely strong cohesion -- better than 
> is possible in OOP. eg, generally, private class functions aren't 
> completely private in OO languages. They appear in vtables, for example.
> 
> I don't think this programming paradigm has been very well explored yet.

Yeah, I like nested functions too. Although I didn't need to use them 
much so far, maybe because I like to keep my functions very small.




More information about the Digitalmars-d mailing list