Sometimes you get to wondering when to make objects... or when to stick to a basic premade type and call some methods in your normal class to change them.
When you find yourself wanting to do something like...
myThing = doSomethingToMyThing(myThing); //if it's local or
myThing = doSomethingToMyThing(); //if it's global
you know you should really make that method belong to myThing's class, since all you want to do is change something about that object.
If there's no such handy method in the MyThing class, it may be time to make your own object extending it, and give it the method. It's the OO way!
cuz myThing.doSomething(); just looks cleaner, don't it?
Thursday, January 15, 2009
Thursday, January 8, 2009
No join method?!
Wow, I was raised on perl so this came as a bit of a shock...
the opposite of split is... nothing
boo. shame on you, Sun.
the opposite of split is... nothing
boo. shame on you, Sun.
Subscribe to:
Comments (Atom)