- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
she_bop.she_wop()
Admin
duh!
Admin
If Cyndi Lauper took up programming...
Admin
She bops a lot, but he doesn't bop at all.
Admin
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!
Admin
#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#....
Admin
If your new app is still running in parallel with the old app after twenty years, what you have is two old apps.
Admin
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)
Admin
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.
Admin
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.
Admin
... This is nothing to do with the for-case pattern. (Of course it's still bad in other ways, just not that one.)
Admin
"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!".
Admin
She bop, he bop, we bop I bop, you bop, they bop
Admin
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.
Admin
"They've been running in parallel for twenty years..." 🥇🥈🥉🏅
Admin
Now it's a second-order legacy system, soon to be third.
Admin
Well you can't buy from yourself. DUH.
Admin
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.
Admin
This submission was mine. I only posted it last week.
Admin
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....
Admin
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,
Admin
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.
Admin
Who put the "bop" in the "bop-she-bop"? Who put the "duh" in the "bop-dbg-ding-dong"?
Admin
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"); } }
Admin
early exposure to FORTRAN doesn't heal. Electrical Engineers worst hit,
Admin
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.