in reply to Light Bulb Joke
The answer is, procedurally you would do "$light_bulb = ($light_bulb + 1)" or something, rather than, in O-O, "$light_bulb->change(1)"
The original answer about the message is OO and is well done. Messages are a SmallTalk thing. Your proposed solutions are, at least to SmallTalk fans, less OO than the original punchline. The first one is essentially non OO, just disguised by the class syntax. Much that is attributed to OO is really just procedural code with method scope and instance variables (call this "half-OO"). Few actually take the plunge to where it is meant to go.
|
|---|