Re: Labeled Loops?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Jeremy Cowgar wrote:
> 
> Jason Gade wrote:
> >  
> > Just to be clear, for labeled loops, I would hope that the programmer would
> > choose a better variable name than "a".
> > 
> 
> Depends on how complex the loop is for me. If it's only a few lines, I'll
> commonly
> use a,b,c or i,j,k for loop variables.
> 
> }}}
<eucode>
> for a in 1 to length(lines) do
>     line = lines[a]
>     puts(output, trim(" \t\r\n", line) & "\n")
> end for
> </eucode>
{{{

> 
> You'll find code like that in my production apps. Now, am I going to do a lot
> of processing on it? Is the loop many lines long? Sure, a more appropriate
> name
> will be given, but in the above example? nah, a is just fine for me.
> 
> --
> Jeremy Cowgar
> <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a>
Well, yeah, I do loops like that too for simple loops. But for something where
you are going to have some kind of complicated exit/continue semantics seems like
a not simple loop.

--
A complex system that works is invariably found to have evolved from a simple
system that works.
--John Gall's 15th law of Systemantics.

"Premature optimization is the root of all evil in programming."
--C.A.R. Hoare

j.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu