• (nodebb)

    This is gold! A For-Case that doesn't need the For nor the Case. 🤣

  • Zatapatique (unregistered)

    It could be so much improved:

    if (frist) step1(); if (secnod) step2(); ....

  • 516052 (unregistered)

    I feel cheated. There is no switch, only if.

  • Lurk (unregistered)

    I think this may be the result of a dead requirement. At some point there was a perceived need to be able to execute steps 1 - n in a runtime determined order and the order of steps would be handed in as an array, list, whatever. The requirement got dropped or it was realised that there were no circumstances in which the steps would ever be run in any but one order, but the (part implemented?) code didn't get cleaned up properly.

  • (nodebb) in reply to Lurk

    Or perhaps there was some additional logic at the beginning/end of that loop which would run between each step, but it got removed at some point?

  • (nodebb)

    Wait, maybe I'm getting old and senile but isn't that just this?

    step1();
    step2();
    step3();
    finalStep();
    
  • (author) in reply to MaxiTB

    You're more with it than the developers responsible!

  • (nodebb)

    Somone started with a for-loop and then got told about this newfangled thing called a "race condition" ....

  • Goose (unregistered) in reply to MaxiTB

    Yes, yes it is.

  • (nodebb)

    Ah okay. I thought it can't be that easy and there's some hidden thing I missed.

    Welp, I guess there's always a complicated way to waste processing resources lol

Leave a comment on “A Case of Old Code”

Log In or post as a guest

Replying to comment #688925:

« Return to Article