• David (unregistered)

    A little part of me has just died...

  • Barry E. (unregistered)

    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.

  • Phil Scott (unregistered)

    If I was paid by the line, that's some might fine code. Perhaps the coder used a for loop to generate HIS code?

  • Jason Hasner (unregistered)

    LOL!

    What can you say besides WTF?

  • Centaur (unregistered)

    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 :)]

  • Mike Woodhouse (unregistered)

    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...

  • P&#243;lya (unregistered)

    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.

  • Alex Papadimoulis (unregistered)

    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.

  • Jose Torres (unregistered)

    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 [...]

  • minghong (unregistered)

    I just can't stop laughing...

  • KoFFiE (unregistered)

    I hope he at least used copy/paste, but I'm afraid he didn't... :D

  • imbrius (unregistered) in reply to Barry E.

    Geoffrey Chaucer*

  • anonymous (unregistered)

    For loop? This is really more of an array type problem

  • Sebastian Ramadan (unregistered)

    Can I have an invite?

Leave a comment on “A loop for whom? For me? For you? Huh?”

Log In or post as a guest

Replying to comment #:

« Return to Article