Zane Gilmore wrote:
On Thu, 2004-03-11 at 18:58, Steve Holdoway wrote:
<snip>

Five lines is extreme, yes. But you've obviously not tried this method
of programming. If you do a top down design, and then a bottom up
implementation, these functions become the building blocks of the
higher level code. Not only that, you can rely absolutely on them once
you've completed them, which makes the higher level code much easier
to debug, and much more reliable when written.


I *have* tried programming like that and initially, I have to admit,
that it started to look like those promises would be fulfilled but alas
no.


I know that your friend and mine BillWithTheGlasses has done his best
to eradicate the design and analysis part of any project, but it does
make for a far more robust and maintainable product.


The part that I dispute the most is the maintainability. When you have a
respectable sized project. What starts to form is a maze of hundreds of
tiny little functions all forming a call tree dozens of layers deep.


In a debugger the call stack looks like a directory listing!
Trying to track down what function/method is doing the thing you're
trying to stop or change can be a nightmare.

I am certainly an advocate for simple and elegant code but extremism
with function size IMO is something that should be avoided.

Sometimes a great big central function is a simpler option to a cascade
of tiny little ones.



5 lines gets my vote. I have been working on some 400 line functions recently (no comments either...) and I just ended up abusing the people around me in the office!!!!
Anton


-=-=-
... "Emergency!" Sgiggs screamed, ejecting himself from the tub like it was
a burning car. "Dial 'one'! Get room service! Code red!" Stiggs was on
the phone immediately, ordering more rose blossoms, because, according to
him, the ones floating in the tub had suddenly lost their smell. "I demand
smell," he shrilled. "I expecting total uninterrupted smell from these
f*cking roses."


Unfortunately, the service captain didn't realize that the Stiggs situation
involved fifty roses. "What am I going to do with this?" Stiggs sneered at
the weaseling hotel goon when he appeared at our door holding a single flower
floating in a brandy glass. Stiggs's tirade was great. "Do you see this
bathtub? Do you notice any difference between the size of the tub and the
size of that spindly wad of petals in your hand? I need total bath coverage.
I need a completely solid layer of roses all around me like puffing factories
of smell, attacking me with their smell and power-ramming big stinking
concentrations of rose odor up my nostrils until I'm wasted with pleasure."
It wasn't long before we got so dissatisfied with this incompetence that we
bolted.
-- The Utterly Monstrous, Mind-Roasting Summer of O.C. and Stiggs,
National Lampoon, October 1982

Reply via email to