• Ondřej Vágner (google)

    she_bop.she_wop()

  • (nodebb)

    duh!

  • (nodebb)

    If Cyndi Lauper took up programming...

  • (nodebb)

    She bops a lot, but he doesn't bop at all.

  • dpm (unregistered)

    I admit I have never seen a value for a "case" statement explicitly stress that it is a positive value, as opposed to those vague, namby-pamby, who-knows-what values that lack a plus sign. Belt and suspenders!

  • (nodebb)

    #1) CAN it be EASILY calculated???? #2) "Just read the code," is a wonderful sentiment.... How about reverse engineer from a (debug/nonoptimized) EXE/DLLs from C++ into C#....

  • my name is missing (unregistered)

    If your new app is still running in parallel with the old app after twenty years, what you have is two old apps.

  • Anonymous') OR 1=1; DROP TABLE wtf; -- (unregistered)

    Why the three arrays for buy_from, buy_price, and buy_bid, when they clearly know how to use structs

    DUH! Everyone knows that the SOA pattern gives better cache performance than the AOS pattern, so clearly that should be used everywhere without bothering to profile your code since it's obviously faster.

    (/s in case it wasn't obvious)

  • Anonymous coward (unregistered)

    Once upon a time I had to replace an Excel enterprise solution. I asked a few questions about functionality I found in the code. Nobody new about the functionality. I was happy to throw away 90% of the terrible old code.

  • jochem (unregistered)

    Trwtf is that it's not a range from -5 to 5. 0 is skipped for some weird reason. Good have mercy on the soul having to maintain this.

  • I'm not a robot (unregistered)
    Here, we have a for-case antipattern that somehow manages to be wrong in an entirely different way than the typical for-case pattern.

    ... This is nothing to do with the for-case pattern. (Of course it's still bad in other ways, just not that one.)

  • (nodebb) in reply to Anonymous') OR 1=1; DROP TABLE wtf; --

    "Why the three arrays for buy_from, buy_price, and buy_bid, when they clearly know how to use structs DUH! Everyone knows that the SOA pattern gives better cache performance than the AOS pattern, so clearly that should be used everywhere without bothering to profile your code since it's obviously faster."

    Actually performance can bwe significantly different (if L1/L2 and pipeline organizations are deemed to be sufficient)... Motto from 40+ years ago: "No good shooting where the plane was!".

  • tank0r (unregistered)

    She bop, he bop, we bop I bop, you bop, they bop

  • Loren Pechtel (unregistered)

    There's something missing from the analysis here:

    It does not do the same thing for every input value!

    If the input value is in the -1 to -5 range it wants to sell. If the input value is in the 0 to 5 range it wants to buy. Obviously, zero is neither sell nor buy and so we shouldn't be doing a transaction at all and won't reach this bit of code.

    I'm going to go out on a limb and suspect the values are ratings. Some prior bit of code has rated stocks from -5 (horrible) to 5 (wonderful). This is going through and applying that to their portfolio.

  • (nodebb)

    "They've been running in parallel for twenty years..." 🥇🥈🥉🏅

  • (nodebb)

    Now it's a second-order legacy system, soon to be third.

  • tbo (unregistered) in reply to jochem

    Well you can't buy from yourself. DUH.

  • Argle (unregistered)

    The worst thing I dealt with on a legacy system re-write (BASIC, circa 1988 to C#) was that there were recognizable bugs.I had to match outputs, so for once in my life I was deliberately creating bugs.

  • Prime Mover (unregistered)

    This submission was mine. I only posted it last week.

  • linepro (unregistered)

    Been there done that.

    We wrote an options valuation suite with Black Scholes in 32 c.

    The head of trading then used his Casio 10 digit calculator (as he always had) an "proved" that we were wrong.

    We spent a weekend fixing the "critical bug" by rounding every step to 10 decimal digits....

  • Old timer (unregistered)

    Non zero-based arrays indicate that the original source was probably Pascal.

    Sub-arrays are typical for buy/sell data, because "array of array of struct" and "struct of array of array" don't reflect the structure of the data. It's best represented by "struct of array of struct of array " or similar,

  • Bat Conley (unregistered)

    Well, with a little luck, in eight more years they can finally put it in production. It should work then at least until 2100 -- and some AI can fix it if it fails then.

  • Ollie Jones (unregistered)

    Who put the "bop" in the "bop-she-bop"? Who put the "duh" in the "bop-dbg-ding-dong"?

  • gnasher729 (unregistered)

    Easily changed:

    for (; i < *prow; ++i) { int offset = abs(she_bop.pair_number[I]) - 1; if (offset >= 0 && offset <= 4) { sell_from[j+offset]=she_bop.from[i]; sell_price[j+offset]=she_bop.price[i]; sell_bid[j+offset]=she_bop.bid[I]; } else { she_bop_debug(SHE_BOP_DBG, SHE_DBG_LEVEL_3, "duh"); } }

  • byzantine General (unregistered)

    early exposure to FORTRAN doesn't heal. Electrical Engineers worst hit,

  • (nodebb)

    I suspect the code was written by incrementally matching new outputs against old outputs and thereby figuring out the business rule, hoping there are no deviating edge cases. Quite possibly the original code was such a mess, that this was easier.

    Of course, the project is on a tight time lime, has been all those twenty years, so commits that "only cleanup stuff" are not welcome.

    Who am I kidding? Twenty years ago the commits were probably files sent by Email.

Leave a comment on “Bop It”

Log In or post as a guest

Replying to comment #536030:

« Return to Article