[Tutor] RE: global vars vs. func args
alan.gauld@bt.com
alan.gauld@bt.com
Tue, 12 Mar 2002 17:18:51 -0000
> > """If you have a procedure with ten parameters, you probably missed
> > some."""
>
> Is this sarcasm, or seriousness?
Serious sarcasm.
Most functions should have less than 10 params. If you have
one with 10 the likeliehood is you should rethink the design.
If you really, really do need 10 then the chances are that you
will need even more that you didn't realize at the time,
hence 'you probably missed some'.
> > """Think of all the psychic energy expended in seeking a fundamental
> > distinction between "algorithm" and "program"."""
>
> I was wondering the very same thing. An algorithm is like a
> progam-within-a-program, isn't it? I like this quote, if I'm
> interpeting it correctly.
In the early days it was true. Today many programs encompass multiple
algorithms - think Microsoft Word - is that really 'an algorithm'?
But it certainly encompasses plenty of algorithms.
But if you look at traditional batch programs then they are
mostly single algorithm programs so there is a valid (and
essentially worthless) debate over the semantics.
> > """Interfaces keep things tidy, but don't accelerate
> growth: Functions do."""
>
> This one is a bit beyond me.
Me too, I'm interested in an explanation coz I can think of
several(contradictory) options!
Alan g