- 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
reTERN $"{Frist:0000}";
Admin
oh yeah, write about converting cobol to java
Admin
Funny you should say that, because we did just that back in the final dying days of C20. And yes, we had to directly emulate the system we were replacing, bugs and all. Which we did, faithfully. Then we went back and negotiated with the customer to actually fix those bugs -- which of course we now knew were there -- and re-calculate his legacy of data, this time without the inaccuracies caused by the bugs.
We managed to pay our bills that year.
Admin
And writing to buffer3 and outbuff would crash with most of the compilers/runtimes I know, as they'll be pointing to bytes in read-only memory
Admin
Hey look, Remy didn't open with his latest adventures!
Was he listening, or am I just seeing correlations without corresponding causation?
Admin
"Note also the check if (OutVal >= 100)- OutVal holds the leftmost two characters of csHold2- so it will never be greater than or equal to 100."
Maybe note the statement right above it, where the rounding could increment OutVal. Or is the real WTF that 99 + 1 is not >= 100?
Admin
I always cringe when I see (supposedly) C++ code with upfront variable declarations. It's a huge red flag that whoever wrote the code is stuck in an old C mentality and doesn't really understand all the advances in software development, both conceptually and syntactically, since sometime around the '80s.
Admin
"C++ didn’t include standard rounding methods for most of its history"
What? C++ has included the "cmath" (a copy of C's "math.h") header since forever... That includes all the standard rounding functions.
Admin
Any port from language to language should involve some minor level of refactoring, at least to take advantage of now-built-in calls that were not built in before.
Admin
I always cringe when I see code without upfront variable declarations because it is a telltale sign of writing code out of your ass instead from the flowchart you made before you started coding.
Admin
| ... from the flowchart you made before you started coding.
Maybe Brian is right - some developers are stuck in the '80s.
And why do you think, that a flowchart mandates upfront variable declarations?
Admin
This. The only time I feel justified creating variables in the middle is a loop iterator or using statement. Otherwise people leave unused or repurposed variables everywhere, to say nothing of pages and pages of tightly coupled spaghetti.
Addendum 2018-10-10 17:22: Sorry, redundant instead of repurposed.
Admin
Don't remind me… I'm working on legacy Perl code that has frickin' use/require statements in subs. (For those of you lucky enough to avoid Perl, that's having an import statement in a function.) With absolute path names to the library. I wonder if TDWTF will accept a submission that is an entire virtual machine image.
Admin
use/require statement inside a subroutine; What was they thinking???? And absolute path as icing on top.
Ok I have made some pretty bad Perl code in my time (some 15 years ago I used $var =
cat $file
instead of opening the file file normally, Yes bad I know), but not once have I been even tempted to do anything like that.That is the IT equivalent of like putting land mines on a playground....
Yours Yazeran Plan: To go to Mars one day with a hammer.
Admin
After verifying that the built-in call does exactly the same thing as the code you're replacing with it, of course.
Admin
"it [OutVal] will never be greater than or equal to 100."
Is it just me, or is it perfectly possible for OutVal to be 100?
OutVal starts out as a conversion of the leftmost two characters from a string to a long. Then depending on the value of the third character in the string (ChkDigit), OutVal gets incremented by one. So if the string starts with something in the range "995" - "999" OutVal will be 100.
What I really want to know is where "m_round" comes from?!?
Admin
WTF is converting a GUI from C++ to C# any time in the last 15 years.