http://qs321.pair.com?node_id=392719


in reply to Hmm...
in thread "if" Considered Harmful in OO programming

Well said! Objects are good when they help.

When I was learning java and OOP, it was fun. However, it was soon easy to use OOP features where they really weren't helpful just to 'use the advantages of OOP', leading to code that wasn't good.

All things in moderation...

Replies are listed 'Best First'.
Re^2: Hmm...
by pdcawley (Hermit) on Sep 26, 2004 at 21:46 UTC
    You're not railing against the OO way of doing it, you're railing against the idiotic Java way of doing it. Take a look at Smalltalk, where even the simplest 'if' statement is implemented using a message polymorphism on the Boolean class for examples of this sort of thing Done Right.

    Of course, you can only really do it right if you're in a language which has blocks/anonymous subroutines, which is where Java falls down.

Re^2: Hmm...
by radiantmatrix (Parson) on Sep 23, 2004 at 15:40 UTC
    All things in moderation...

    I have a close friend who gave me the best advice. She's a nutritionist, but the idea applies to most situations:

    Everything in moderation, including moderation.

    require General::Disclaimer;

    All code, unless otherwise noted, is untested

    "All it will give you though, are headaches after headaches as it misinterprets your instructions in the most innovative yet useless ways." - Maypole and I - Tales from the Frontier of a Relationship (by Corion)

      Moderation in moderation? If that allows for running amok periodically, I'm all for running amok.

      Naaaaaaaaaaaaarf.....