[Haskell-cafe] Thoughts on Haskell and OOP

Colin Paul Adams colin at colina.demon.co.uk
Fri Jan 2 01:39:02 EST 2009


>>>>> "Kevin" == Kevin Van Horn <kevin at ksvanhorn.com> writes:

    Kevin> What do the rest of you think?  Is my analysis correct?

No, because ...

    Kevin> Properly used, OOP is all about interface inheritance, not
    Kevin> implementation inheritance.  (At least in C++,
    Kevin> implementation inheritance -- inheriting the data members
    Kevin> and method implementations of a base class -- usually leads
    Kevin> to bad design, and is discouraged by the experts.)

But C++ isn't OOP. It's a bodge where OO stuff is added on top of
C. Naturally, this doesn't work out well. But that isn't necessarily
why C++ doesn't vdo implementation inheritance well.

Properly used, OOP is all about interface inheritance and
implementation inheritance, with contracts used to ensure semantically
correct behaviour.

See Eiffel.

-- 
Colin Adams
Preston Lancashire


More information about the Haskell-Cafe mailing list