Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Re: Re: Re: Short routines matter more in OO?

by Anonymous Monk
on Oct 13, 2003 at 18:25 UTC ( #298909=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Re: Short routines matter more in OO?
in thread Short routines matter more in OO?

Guess why books for children use short sentences.
Because they are geared toward people who are still learning the requisite language skills.
Guess why most programming introductions start with printing Hello, world.
Because they are geared toward people who are still learning the requisite programming skills. And Mathematical introductions don't begin with integrals and derivatives either, but that misses the point as entirely as your two examples.

One of the tasks of a programmer is to manage complexity. The size of a routine is a trait that is causally unrelated to complexity except in trivial cases. It is true that relatively shorter routines are often a by-product of good complexity management, but not by virtue of shortness itself. The aim should never be about making something smaller, it should be about making it simpler (and simpler for a routine can be with respect to several variables, both locally and globally).

$simpler != $shorter;
In fact, as some studies have shown, simpler (in terms of errors, changes required, and even comprehensibility) is not even correlated with smaller size (within upper bounds ranging from 100 to 500 line routines). And with that in mind, I'll paraphrase Einstein: routines should be made as simple as possible, but no simpler!. People who equate smaller with simpler often overshoot the target.
I do not know of any study. I don't care much about studies either, since few are done using the right context and variables.
Well, the head-in-the-sand tactic is a common defense of personal opinion.


Comment on Re: Re: Re: Re: Short routines matter more in OO?
Download Code
Re: Re: Re: Re: Re: Short routines matter more in OO?
by Juerd (Abbot) on Oct 13, 2003 at 19:02 UTC

    One of the tasks of a programmer is to manage complexity.

    I like to manage complexity by breaking down the complexity into classes and methods, and keep those methods small AND simple. I know that short doesn't have to mean simple. See Attribute::Property. I also know that simple doesn't have to mean short. But more often than not, they have everything to do with eachother.

    Well, the head-in-the-sand tactic is a common defense of personal opinion.

    Personal study has shown that the sand is nice and warm.

    Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://298909]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2014-08-21 11:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (134 votes), past polls