- 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
This isn't uncommon, even in production systems.
I know a guy who knows a guy (muaha) who works for a major Credit Processing company. They run records for all the major bureaus. The original code is Perl and C, with Java bootstrapped in.
The main bureau who funded the founding of this Company tried to take it over, stating that the Company, along with the code it developed, belonged to the bureau.
Apparently the president (who was the dude who wrote the original core) wasn't worried. The code was so kludgy that there was no hope for the bureau to manage it.
Most software in large companies grows very... organically. Hack here, hack there... soon the thing is just a bunch of lines of code that somehow manage to form a program.
Admin
You're assuming it's a built-in hash. Could be something they coded up.
Admin
Anyone who thinks this is bad is clueless. This is the optimal Enterprise Solution. Obviously this developer was more concerned with the cost of developing a solution that forced a redesign of the Enterprise Software, so he used the existing tools available to get what he needed. Weighing the decision of development time vs. performance and stability is important in an Enterprise Solution.
The Quality of this Enterprise Software is incredible. It's well documented, unlike some other "Enterprise" solutions we've seen recently. That means it will reduce costs of future maintenance when the Enterprise must warp itself to a new business sector!
Really, this isn't so bad. A little runtime performance in return for well documented Enterprise code that obvioiusly cost very little (he didn't even work overtime!) to implement.
Admin
No, thats not a WFT at all. Not every programmer can or should know every syntax for every language to know which programming practices are good and which are pure evil.
In fact, with respect, your statement is a WTF as you are confusing 2 very different things: computer syntax and computer practice. The first is particular to a language; the second is general across the profession. It would not bother me in the slightest if someone in my team did not recognise which actual language this snippet is written in (unless, of course, they are C++ or C# programmers - in the former case they should recognise their language; in the latter case they should realise its not their language). It would, however, be a cause of grave concern if someone in my team did not immediately realise that what this "programmer" tried to do was an incredibly stupid language-independent thing to try to do (made worse still by the multiple errors in implementation).
Hope I've not caused any offence.
Admin
Not necessarily - he knew there was a chance that he might leave it in, but if he fixed it, he'd remove the comment.
A bit like one of those "leave a letter with the lawyer who will open it if I don't return from visiting my ex-wife" ;)
Admin
Ah, yes. The Big Ball of Mud. For those who haven't already read about it: http://www.laputan.org/mud/
Long, but educational.
Admin
Have to agree, a very good one!
Admin
This is a great WFT to be sure.
Logs as data, who'dathunkit
but what baffles me is why the original programmer couldn't just find out where the log was being written and thus what mysterious algorithm came up with the accountId to be logged in the first place.
Admin
C++
(Someone else said C#, but C# has null as a lower-case keyword.)
Admin
ParkinT
I notice your signature, and yes, I too have wondered why there is brail on the drive up ATMs.
Reason: Because they use a generic keypad.
Admin
Disclaimer first: I'm not saying this is C#. I aggree with the majority that this is C++.
That said, I think it's technically possible to have this as part of a C# programm that compiles.
We do not know the class of AccountId, we do not know the FileHandle class, we do not know the class of NULL.
By overriding the == operator and/or providing implicit conversions it should be possible to compile that stuff. Of course that doesn't mean it would do anything usefull.
Admin
Was it really easier to (a) cruft together this log-scraping garbage AND (b) write a long rambling apology about it than to simply FIX THE ORIGINAL PROBLEM ALREADY ?!
Admin
Are you on drugs? This is nothing like Delphi. (If it was Delphi, it would be great. The curly braces would mean that almost everything has been commented out.)
Admin
I think changing (AccountId == "") to (AccountId.equals("")) would have fixed the problem
Admin
Apart from the technical evils, did anyone notice the programmer's self-imposed time frame for correcting the code?
>I was honestly planning on removing this tomorrow
When, exactly, does tomorrow come?
Admin
It has been a while but I am almost certain that ServerSession does exist in Borland C++ and I am absolutely sure that TString is a class in Borland C++
This is Borland C++ and probably even done with Borland Builder.
Admin
Bah -- Just ask the user to type it in. Again. And again. And...
Admin
PERL! Do I win a prize?
Example? Actual code, actually run:
$ perl -e ' print "|" . $hashvar{NonExistentKey} . "|\n";'
||
Admin
No, because you are not the first one to point that out.
Admin
I am a newbie programmer and I am trying to figure out the context of this code and what is wrong with it from the experts here. Could someone help by commenting on each line as to what is wrong with it. Sorry if this is not supposed to be asked here but I am trying to learn. Thanks
Admin
The WTF is not how it is done but what is done. For some reason, at this point of the program, the program somehow forgot the AccountId and recovers that by reading through the log file. A very stupid way to work around a bug instead of fixing it.
Admin
Ah, but I *was* the first to give an example. So THERE! :-P
NOW do I get a prize? Maybe just a cookie?
Admin
This code is from Battlefield 2
I would know.
I wrote it.
I never did fix this problem or even know what is wrong..
the Whole Battlefield 2 game is in debug mode
we have some bugs in the release mode that stop it from running.
so we just released the debug version.
you can even download the obj files on the net.
Admin
Admin
While I don't really believe this guy. I will say it has happened before.
Getting a .map or .pdb for game is like being a kid in a candy store!
There isn't an easy way to put the genie back in the bottle either unless you refactor ALL of the code I can still solve new offsets based on it trivially.
Then again, I can find whatever I want anyways... it just takes a lot more time/effort.
Admin
They love me! They REALLY *love* me! I shall love and cherish it always! I'd like to thank ammoQ for making this all possible, my agent, my parents (I love you Mom!), my cat, the goldfish...
Admin
he has to read th entire log file to get the LAST entry.
sorry for defending that jerk ...
Admin
You know, I agree. Granted, it's a WTF that the code is even there, but I'm still impressed that the original (wtf)coder said WHY it was happening (e.g., "I have no ide why this isn't set properly already").
Admin
...
Admin
Well... At least he did not lie in his comments.
I had a projct where I could not trust any of the comments.
The first and only comment I read/trusted(my mistake) was: // We do no add this service's fee to the bill // since there is no such service in this case
Guess...
Admin
You know if he had just implemented a Developmestuction Environment(tm) he could have found the original bug an not had to write either the ugly bad code to parse the log file or the ugly bad apology to those who come after.
Admin
I would like to be probably the 100th person to say, simply, OMG.
Actually OMG is an understatement. You'd really do this?
Reading through a log file to find data rather than fixing an actual, serious bug in your code ? I need to go destroy something now. As someone who gives a crap about quality, and has actually worked at jobs where code review was part of the process, this makes my head tingle, it's so bad. The concept that this made it's way into a real, production system and survived even one release... so scary.
I suppose it's nice that the guy actually commented this and was aware of how bad it is, but... being aware, did he talk to anyone else about it, or the core problem? Knowing how bad it is, why did he put it in ? Can we get a video of him pounding his head against a wall repeatedly? Please ?
Admin
I'm so glad this is commented. That means we can easily identify this code as bubble gum over a hole in the hull of the titanic. At least we know that the hole is on the starboard now.
Admin
Nope. C# allows this Just Fine...
object NULL = null;
string AccountId = "whatever";
if( AccountId == NULL ) { }
(I don't know WTF someone would want to though...)
Admin
Two other reasons: a blind person might be behind the driver, in the back seat (like in a taxi) - and/or - installing Braille keypads universally is probably simpler than trying to create exemptions from the Americans with Disabilities Act.
Admin
I find this quite humorous also. Here I am, a software developer with way too many years of experience, and I didn't recognize this code as C++ (a language I have never coded in, and only debugged once - 8 years ago). And yet, even though I couldn't identify the language, I still have the wherewithal to call others morons. WTF coders, inept fast-food workers, bumbling government drones, too many more to list - all morons.
And why do I have the wherewithal to call these people morons? Because, even though I can't identify all programming languages by sight, I can code in a good many of them, and this ability provides me with a very good income. This wherewithal greatly increases the probability that I will never be looking to any of these lesser people for jobs or favors, and allows me the pleasure of spurning them.
Oh - or perhaps you meant to write "(unmitigated) gall"?
(Adding one more to the list.)
Admin
Actually, while Borland Builder uses TClassName style to name all thier classes, their string class is called AnsiString. hehe.
I have no idea why. But I'll go ahead and mention that the reason they have their own string class is to be binary-compatible with Delphi's strings.
I'm going to bet the poster's orginization had developed a bunch of custom C++ back before the Standard Template Library became.. standard. That probably also explains their renamed file operation functions (maybe had to avoid a naming conflict? Maybe those are special ones that call the Windows CreateFile and ReadFile, but use the arguments of the classic unix versions?) and they probably also wrote their own map-ish thing for ServerSession.
Admin
I hope this gets read. Yes, it's a huge WTF and funny because it's not in source I have to deal with... but, I think this highlights why it's important to have a culture within a dev team of talking about errors and bugs openly rather than sweeping them under the carpet (like this) for fear of losing respect, being judged, etc.. etc..
Admin
<FONT color=#800080>[grenade tossed in middle of discussion...]</FONT>
[:P] WTF "coup de grâce" 3...2...1...
<FONT color=#ff0000> Do you think the log file contains XML? Brillant! [:^)]</FONT>
<FONT color=#800080>[...running for cover under closest cubicle!]</FONT>
Admin
Ah yes. A language flame. I did indeed mean "gall" as it were. Interesting how you take the stance that because you make a better income than low-wage workers that you're somehow better than them. Even more interesting is how you take the stance that because you feel yourself superior, you have the right to call these people morons and look down upon them.
I too have a good job designing and implementing software. I would wager that I have more experience than you, and more than likely more programming languages under my belt than you can count. My point however is that you are all so quick to judge (and perhaps this doesn't directly apply to you in particular), however half (or more) of you can't even do a cursory search on languages via google, and get a few source examples and reasonably identify a language.
Admin
Who cares which language that WTF is in! WTFs can be implemented in any language. Do you all not have anything better to do?
Admin
You're joking, right? People are spending time here laughing about other peoples' WTFs :)
Admin
???????????
??!!!!!!!!!!!!!!!!!!!!!!!!!!!
Admin
The guy will no longer cause any havoc on the floor, he was promoted to management ...
Admin
All interesting, and they might have an element of truth. However they all miss the fact that the question assumes something that is not true. That is you cannot ask this question unless you assume that an ATM designed to be used from a car cannot be used in any other way. Have you ever seen an ATM with guards of some sort in place that prevent someone on foot from walking up to it?
I know that more than once I have WALKED to my local drive up ATM to get my cash. (I once had a car where the windows did not work, so even when I drove to the machine I had to park and get out of the car to use it)
While the positioning is not ideal for someone trying to use the machine on foot, I have never had a problem doing so.
Admin
On Fridays (when I bank), my bank closes the lobby at 5:30 PM and the drivethrough at 6:00 PM. My usual Friday bus gets me back home at about 5:40 PM.
Sincerely,
Gene Wirchenko
Admin
Interesting how you take my statement I consider that "WTF-coding, bumbling, inept [people] morons" and transform it into "low-wage workers are morons and therefore less than me". Many of the WTF coders I've seen here undoubtedly make more money than me, as do many "bumbling government drones" (not fast-food workers, though). I can, and do, look down upon ineptitude, and when I do something stupid, I deserve to be called on the carpet and ridiculed, too.
My point is that it's unlikely that the inept people I call morons will ever have any significant influence in my life and I can write them off, partly because of my income.
As for your experience? Possibly, and good for you. Language tally? Patently false.
And quick judgement? You couldn't even search a dictionary site to clarify a word you didn't know how to use, and yet you take others to task for not Googling for programming languages? Pot - kettle, hence the flame.
Admin
<font style="text-decoration: underline;" size="4">DAYUUUUUUUUUMMMMMMM! </font>
This has got to be a joke, right?!?!?!?!?
Admin
well I hope the company fails as misearbly as it can, for the lack of support it has shown to just one branch of operations
Admin
Ironic story: for our software engineering class we were writing a plugin for a java application.
The application was buggy and hackish and the ironic part was that at the beginning of the semester the guy who wrote the app linked us to this article from the professor's website.
So for the rest of the semester everywhere in the non-final version of our code we made references to this article and always apologized if anything was even remotely hackish.
The prof seemed to enjoy it much!