D - more power than (really) needed !

Hasan Aljudy hasan.aljudy at gmail.com
Thu Mar 9 07:46:15 PST 2006


Walter Bright wrote:
> "Craig Black" <cblack at ara.com> wrote in message 
> news:dun68p$30kv$1 at digitaldaemon.com...
> 
>>A lot of the bias towards OOP purism comes from Java vs. C++ comparisons, 
>>much more convincing than Anything vs. D.  Hopefully the simplicity and 
>>power of D can help to eliminate OOP purism.
> 
> 
> The trouble with OOP is, well, not everything is an object. For example, 
> take the trig function sin(x). It's not an object. Of course, we could bash 
> it into being an object, but that doesn't accomplish anything but 
> obfuscation.

That's because we've been taught math in a procedural way ;)
Ideally, x, the angle, would be an object, and sin is a method on that 
object.
However, I think that we're so used to think about math functions in a 
procedural way, so it's better they stay procedural.

Like you said, it'll be a bit confusing if it was an object, but that's 
not because it can't be an object, but mainly because that's not how we 
think about it.


> Sometimes, I think C++ went hard over in the opposite direction - nothing is 
> an object. OOP programming seems to be regarded as "oh, so 90's" by the 
> modern C++ crowd.

C++ doesn't really support OOP .. it's just a myth :(







More information about the Digitalmars-d mailing list