- 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
Well, at least the inner variable declarations didn't use
let
...Admin
Hard-coding all of the needed data in the JS code? How nice!
Sending an XMLHttpRequest to the back-end to get the data in JSON format was likely too much effort.
Admin
Having worked for both the feds and government contractors, I can absolutely confirm that their code is just as bloated and inefficient as anything else they produce.
My favorite story? I was working on a project in which they decided to take a novel approach and write in C instead of Ada. That's C, not C++, even though the nature of the project fit perfectly with a polymorphic design. Instead we had tons of duplicated code for each struct type, that differed from each other by only a handful of properties. On top of that, the project managers, in their infinite wisdom, knew that pointers were dangerous, so they decreed in the requirements that there shall be no pointers. Period. So you've got these large structs being passed by value into every method. And they wondered why they were having trouble meeting their performance targets...
I finally convinced them that what they were really afraid of was dynamic memory allocation (they were all about being "deterministic"), and there are plenty of legitimate uses for pointers aside from that. Never did get them to see the light of OOP though.
Admin
Wait, this is government we're talking about... add an extra s/too much/not enough/ to that.
Admin
I do find it amusing that any government activity is met with cries of "privatize it all, fire all the bureaucrats" and any government privatization effort is met with cries of "outsourcing firms are all crooks" accompanied by stories of their incompetence, contract overruns, nepotism, etc.
Look at government pay for these kind of jobs vs. what you make. Now take into account: you get what you pay for, paying more to get better developers means your taxes would go up, training people costs money too.
Government tends to exhibit the worst traits of Deadline Driven Development, largely due to those deadlines being dictated by elected officials or political appointees who know nothing of the subject matter.
Admin
I wouldn't bet on it... lots of competition out there! (the French government is a serious contender)
Admin
Those of us who were in any business that contracted with the USGov't knew very well the cliche "close enough for government work."
Admin
Actually it was nice that the configuration was delivered in the page rather than needing a further request. After some analysis the conclusion was that
streamArch
should be populated from thearch
row of the configuration, so if we de-structure each row asstream_num, domain, stream_id, msl3
and get thefilename
andcomm
query parameters from the URL, there are 4 candidate stream URLs:Then try each of
hls_live, msl3_arch, hls_url, hls_arch
in order ... but so far only the first case has ever happened. There could be more legacy than you'd expect for code that can't be more than 250 years old.Admin
WTF? Email protection in a plaintext field?
The corrupted text was
_1
followed by the at sign.Also, loving the non-JS reCAPTCHA!
Admin
I've seen the "for break;" pattern a few times, some people think its a neat trick to deal with something wich might be empty...
Admin
The density of WTFery in that one line is a joy to behold.
Admin
Our government contractor was finally able to switch from JOVIAL to C++ for the first time. The manager wrote his own list of coding standards, which consisted of decrees like You can’t use ++ , — , += operators. You must say i = i + 1; You can’t overload anything. You can’t inherit anything. Don’t even dare use the “P” word (Polymorphism).
When he was done, their C++ code looked exactly like JOVIAL code.
Admin
Why? Granted, I'd prefer a more traditional sentinel value like undefined or null, but in the end any sentinel value will do (note that (X==false) != (X===false) for some X, e.g. "").
The #1 WTF is re-assigning only a part of the set of variables, which might cause a state that is a mixture of independent old and new data (but the missing context just might make it acceptable if every variable is in some sensibly way initialized beforehand).
#2 is a dubious choice in client ~ server responsibilities.
#3 is using a loop-construct that never loops. That's just loopy.
#4 is using magic indices in preference of a data structure that is more mistake-proof.
#5 is redeclaring variables.
#6 is about variable names, #7 comments, #8 indentation (but all such aspects are relatively harmless).
I left 2 spots , but I don't see how "if (comm === false)" can make it into the top 10.