|
Posted by Chung Leong on 10/22/98 11:52
Rik wrote:
> In this particular case, it might. But normally I like classes just for that
> reason: avoid cluttering of variables, huge if..else.. statements or
> switches. Also, scalability comes into play. It might be a simple script
> now, but it might grow, which is easier done in OO in my opinion, because
> everything has got it's own scope. That also means it almost certainly won't
> interfere with already existing code in a project where you want to make us
> of the class, which is often the case with procedural programming.
There was a study a couple years ago comparing the productivity of
office workers with cluttered desks vs those with clean desks. As I
remembered it the conclusion was that those with cluterred desks tend
to be somewhat more productive, while those with the cleanest desks
tend to be least productive. It's not hard to understand why. Obviously
the person with the clean desk has to spend time cleaning it. Moreover,
he might tuck things away so thoroughly that he can't find them
anymore.
The same is true is programming. People don't look at code to
appreciate its beauty. In order to maintain a piece of code one has to
have a clear picture of what it does. Hidding details away that has
bearing on its behavior makes it harder to understand.
As for the code in question, like I said, it was written for an
article. So I prettied it up and gave it a snappy name. It does work
though.
Navigation:
[Reply to this message]
|