News for hackers. Stuff that matters.
Re:OOP practiced backwards is "POO" by gnaritas on Friday December 10, 2010 @09:34PM (#1993974)
This presumes I ever want to ask an object what its type is, but that's generally not a good OO way to accomplish something. I'd rather tell the object what to do and assume it does the correct thing for its given type. If I must, I can always ask if it understands a given message, but that's to be avoided as well.

Interfaces are useful in defining what an implementor must provide, but an example implementation does this as well.

Re:OOP practiced backwards is "POO" by rapind on Saturday December 11, 2010 @03:52AM (#1994500)
this.

Also, if it helps, just think of the impl as an interface with a default behaviour that should be overriden ;)

If this is too forgiving, then we can even have the impl methods throw errors ("override me!") and simulate an interface.

Re:OOP practiced backwards is "POO" by gnaritas on Saturday December 11, 2010 @10:46AM (#1994984)
In Smalltalk, I can have all the methods throw

    someMethod
        self subclassResponsibility
and then use the realize class refactoring on a subclass to generate stubs for all methods I must implement, just like an interface.