Comment On A loop for whom? For me? For you? Huh?

... at least, that's what I'd imagine the programmer behind this snippet of code (sent in by now-GMailer Jose Torres) would say if you recommended using a FOR LOOP: [expand full text]
« PrevPage 1Next »

re: A loop for whom? For me? For you? Huh?

2004-06-16 15:16 • by David
A little part of me has just died...

re: A loop for whom? For me? For you? Huh?

2004-06-16 15:20 • by Barry E.
Yes, but perhaps this programmer is compensated the way many great writers (like Jeffrey Chaucer) were...buy the number of words. Why, he took what could have been done in four lines and expounded it to 420 eloquently written, if not slightly repetitive, lines of code!

How many times have you used i = i + 1 instead of i++ in order to make a few extra pence?

You hypocrites.

re: A loop for whom? For me? For you? Huh?

2004-06-16 16:08 • by Phil Scott
If I was paid by the line, that's some might fine code. Perhaps the coder used a for loop to generate HIS code?

re: A loop for whom? For me? For you? Huh?

2004-06-16 16:43 • by Jason Hasner
LOL!

What can you say besides WTF?

re: A loop for whom? For me? For you? Huh?

2004-06-16 23:33 • by Centaur
It’s called loop unrolling, and it’s a speed optimization technique… but not in this case.

* Loop unrolling is reasonable if the cost of executing the loop body once is similar to the cost of checking the loop condition. Adding strings far outweighs comparing integers.

* I’d like to see him change this select into a radiobutton group, and then vice-versa :)

* Anyway, we are barking up the wrong tree here… The usability of two (three?) <select>s for hours and minutes (and seconds?) is, to say the least, questionable. One would be better off coding a single <input type="text"> and then checking for valid time formats. [Oh, skip it… that developer would probably introduce a cross-site scripting vulnerability when coding the “%s is not a valid time” error message :)]

re: A loop for whom? For me? For you? Huh?

2004-06-17 05:14 • by Mike Woodhouse
Just one thought: what is the language? I don't know what uses [] for string delimiters, some kind of scripting thingy? Does it have the kind of loop construct we'd need?

I am intrigued, however, by the apparent absence of evidence that this fine-looking code was the product of copy-and-paste programming. I infer from the changing case of "EndIf" to "endif" that the code may just have been hand-typed from beginning to end. What a marvellous idea. And to think I doubted the assertion that good programmers are 10 times as effective as bad ones...

re: A loop for whom? For me? For you? Huh?

2004-06-17 05:41 • by P&#243;lya
I'm with Mike: what's the language? Maybe this [...] expression is for some kind of pre-compiler and doesn't allow the use of variables inside. Thats the only reason I can think of that would make sense (besides paid-by-the-line). I just can't imagine a programmer who doesn't know the for loop.

re: A loop for whom? For me? For you? Huh?

2004-06-17 12:07 • by Alex Papadimoulis
The language is Visual Fox Pro 6.

- [...] is string delimiters
- and yes, there is a FOR ... NEXT and a FOR EACH loop

and Good call on the alternating case observation! I missed that one myself.

re: A loop for whom? For me? For you? Huh?

2004-06-17 18:41 • by Jose Torres
thank you so much Alex for the invitation... and this code is true... in fact many of my of my co-workers can't believe i just won

i might thank the guy that coded this =P

some stuff about Visual FoxPro 6

- VFP 6 is not case sensitive
- the if statements are endif they are not separated
- in VFP 6 you can use three string delimiters, the all known "..." and '...' and also the [...]

re: A loop for whom? For me? For you? Huh?

2004-06-17 23:43 • by minghong
I just can't stop laughing...

re: A loop for whom? For me? For you? Huh?

2004-08-12 09:05 • by KoFFiE
I hope he at least used copy/paste, but I'm afraid he didn't... :D

Re: re: A loop for whom? For me? For you? Huh?

2008-09-17 10:45 • by imbrius (unregistered)
217890 in reply to 22413
Geoffrey Chaucer*

Re: A loop for whom? For me? For you? Huh?

2009-06-15 16:35 • by anonymous (unregistered)
For loop?
This is really more of an array type problem
« PrevPage 1Next »

Add Comment