- 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
OMG. This post reminds me of two quotes:
"He can compress the most words into the smallest idea of any man I know." - Abraham Lincoln (1809-1865)
"When ideas fail, words come in very handy." - Goethe (1749-1832)
captcha: poindexter - aka the post author's REAL name
Admin
oh yea, and I forgot ...
FIFTY-FIST!!!!!!!
captcha: muhahaha ... weird, i was just thinking that exact word .... this captcha thing is psychic
Admin
I am Sam, Yes, Sam I am, I code all day, To get my pay
The code I write, Is urban blight It should not be, Because, you see...
They want it fast, But hacks won't last, They say: outsource, In sad discourse...
They get it fast, It doesn't last, Fix it they say, Do it the right way...
I know best, Said the PHB, More than the rest, As you can see...
So now it's done, With lots of luck, We cross our fingers, Saying What the fuck?
Admin
hahahahahahahahahahahahahahaha
Admin
Admin
Admin
Admin
As someone who is a only a few years out of college myself, I see the problem in several main points:
The opinion to the world (and many pointy hair bosses) that a "Software Developer" can develop "software" (ambiguous, eh?) - not realizing that is as big of a field as medicine. Doctor's aren't expected to be heart surgeons, brain surgeons, and pediatrics all at once! So why do we expect someone to write an embedded program, good SQL and web applet coding? I can write some kick ass c++, but ask me to write a complex SQL program and my code would look like half of these WTF's too!
Fortunetly, most of the companies I applied for made all applicants take a test before even going on to the interview status - this should be a mandatory thing! Unfortunetly, we just hired my "replacement" (as I'm being promoted), and don't test - and no surprise, though his resume looked good, his English is terrible and he knows nothing (I have NO idea how he got a CS degree).
The lack of training in a particular job to new employees. I was fortunate in my particular job to be put in a group with Senior Developers who taught me everything I know (yes, I have a CS degree, but in reality, that didn't teach much about real programming - OTJ training is EVERYTHING). However, I have interviewed for (and offered positions for) entry level jobs that I honestly told them in the interview I knew nothing about (Oracle, PHP, etc.), and asked, "Would I have a lead or someone to help me out while I learn"? Response came back, "Well we don't have anyone with time to do that, but you'll figure it out." Ok, I'm flattered, but then why are you offering me a job? Cr@p code, here we come...
captcha: pinball - a game that can fascinate me for hours!
Admin
Looking around, I see poorly designed buildings, bad fashion choices, inefficient cars, bad music, bad TV shows, bad movies and corrupt politicians. Exactly why is the bad code surprising?
Admin
90% of everything is crud. -- Sturgeon's Revelation.
Admin
I suppose I should also add to #3 - you are probably asking "If you know nothing about this subjects, why are you applying for a job in them?"... My response is, I have tried to self teach myself, and know enough to write some fabulous examples that could be on this site. However, I am still learning and would love the OTJ training from some people who do know know what they are doing... like an "apprenticeship" like a former poster mentioned...
captcha: bathe - something a few of my coworkers ought to do more often!
Admin
I suppose I should also add to #3 - you are probably asking "If you know nothing about these subjects, why are you applying for a job in them?"... My response is, I have tried to self teach myself, and know enough to write some fabulous examples that could be on this site. However, I am still learning and would love the OTJ training from some people who do know know what they are doing... like an "apprenticeship" like a former poster mentioned...
captcha: bathe - something a few of my coworkers ought to do more often!
Admin
I write software that manages order sets for hospitals. If I get it wrong, then someone does get 300 grams rather than 300 milligrams of something. This can cause loss of life.
And what of you are the one writing the CAD software that they rely on to build these buildings? Make one mistake and the whole thing comes down once it is actually built.
Read my first statement. It could have been the software and not the doctor that screwed up. In our field we are protected from the real world affects of our mistakes fairly often because the users end up taking the fall for it.For every argument there is a counter. Until software companies are held accountable for the software they produce they will not hire people with the credentials to write that software. Even with that, the credentials really don't mean much in a field that changes as fast as ours does.
On the other hand, if software companies are held accountable, then they will pass that accountability down to us, the developers of that system. Ultimately we suffer, because we may have protested a decision but we were required to do it the way the company wanted. This could even be under the idea of "well that isn't our intended use so it won't be a problem" kind of issue until three years later that is the use it is put to. Things are so far out of our hands we have no way to be accountable.
Admin
Coming late to this discussion, so sorry if it is repeated ...
"The only difference between us and them, in fact, is that we know when we're writing bad code."
and some of us will write something like:
// TODO: This is a hack, really we should twiddle the frongle and twizzle the schnarfff
or
// TODO: Hardcoded text string, should have these in a language file
or
/*
But many of the WTFs posted here are actually code that we would not write (well, those of us with a clue!). Failure to understand a platform's API for example (the typical .NET and Java WTFs) or Web Designer turned ASP/PHP/JavaScript coder horror. That doesn't stop the nameVariableMessupOf people though. Like that removeNumeric() that removed non-numeric. Argh. KILLLLLLL!!! Exterminate, Annihilate, Destroy!
Now I'm going down the pub.
Admin
Sometimes bad code comes into existence because of moving targets in a project. Any sort of major change can result in last minute hacks and convoluted glue code to get an almost working project out the door. Sometimes requirements change. I can't count the number of times I've worked on something as per a client's detailed instructions, and then the client said "Hmmm - now that I'm seeing it I don't like it." And you don't want to have wasted all that time (and now you just want to get the damn thing done), so you reuse what you have, possibly improperly. Whenever time is a constraint, there's a good chance even a good coder will do something regrettable but necessary. And there's a very good chance a mediocre programmer will do something awful.
Admin
KattMan: Excellent points, but for most of us, the worst that can happen is lost revenue (for some of us, it could be a tremendous amount of lost revenue).
I would absolutely say that for applications where people's lives are at stake, only the best, most disciplined, and most focused developers be allowed to work on them.
Admin
I pretty much have to disagree with the major premise of this writeup. Yes, we all write code that is far from optimized. In fact, it would probably to be fair to say that the majority of our code is a fair distance away from an optimal solution. Our software is usually inefficient, our code usually repeated somewhere else, and our algorithms usually broken in some non-obvious way.
But I've visited this site for 2 years or so, and there is simply no way that I would ever write any code remotely close to the sheer awfulness of what we see day-in-day-out on this site.
There is a very clear divide between programmers featured in the code posted on this site, and the programmers who frequent the site: They don't have the logical thought process required to be a half-decent programmer. We do.
So the premise of "We can laugh, but our own code is probably not much better" IMO, is bullSH.
Admin
And all of these reasons, collectively, are why we will all have work for the rest of our lives, just not at one employer.
I can't even count the number of times I've re-engineered some application over the years (at any given employer) because they wanted to upgrade from Pascal to C, or C to C++, or C++ to Java, or Java to Java+EJB, or to Web 2.0 to ...
Admin
... and this is a wonderful paper to show the lack of clue ...
"Unskilled, and Unaware of it".
http://www.apa.org/journals/features/psp7761121.pdf
CAPTCHA: darwin? Beautiful ;)
Admin
The most difficult part of looking back on your old code is thinking to yourself, "Wow, I can remember when I thought that was a good idea."
It's at once inspiring and scary - inspiring because you've since learned how to program better, scary because it makes you wonder how much of your recent code will elicit the same response a few years down the line.
At the same time, if you never have this sort of experience, I think that's a sure sign that you picked the wrong career.
Admin
I guess it's just part of learning, as you learn more (or see some examples of bad code which looks quite similar to your own, that's a great moment for realizing your code sucks) you start to see flaws and stupidities in your existing code, I think learning new languages and trying out new ways of doing things helps this quite a bit.
Perhaps if you haven't seen something like this in your code yet you haven't been coding long enough or looking into enough external code to see better ways of doing something, or possibly you're perfect as you say you are (but if that was the case wouldn't you be called $DEITY? :))
Admin
I hate you..!!!!
Admin
The problem with this and other computer fields (Network Architecting in my case, as it's called today) is the skill levels are relative. Who can do it faster, better, cheaper? I'll take the user's perspective, since I USE security software. Sunbelt software's "Counterspy" has proven to be the least expensive and the most effective anti-spyware product - not counting freebies, or you get divide by zero errors on the comparison ;) - out there these days. It's not a resource hog, doesn't pummel you with pop-ups, but catches most of the threats before they can harm your computer. I manage ca. 85 stations at any given time in my company. Number of stations wiped and reinstalled because of SUSPECTED malware infections in the last 3 years: TWO. Webroot's spysweeper is a close second from what review and limited use I've put it through. Spybot use to rule back in 2002, but these days they're second-rate. And, on a different topic, I'm STILL looking for a tool that can REALLY handle rootkits after infection (mostly for the bit of consulting I do). Any suggestions (besides Russinovich's RootkitRevealer and F-secure's blacklight)? Things like being able to debug the code or enhance it at a later date - guidelines could be created for that, so when you inherit someone else's code it's at leastr READABLE and MAINTAINABLE. My 2 cents...
Admin
Jeff, I honestly mean this as constructive criticism. This is why I stopped reading your blog - completely irrelevant posts, and posts where you completely missed the point.
Admin
And I've been through "formal" -- whatever that means; I presume you forgot to type "accredited" -- CS education. I have found it very useful. I did not at the time; in fact, it was very disappointing. However, of the forty or so "formalees" in my year, I wouldn't give you tuppence for more than, maybe, two or three of them. And even that is just a guess.
Apart from the blonde with the big boobs, of course. She was worth thruppence any day.
Admin
In fact, Attwood, given the po-faced premise behind today's "Worse Than FoxNews," is there any chance we can jump past the locale-based disaster that was "Free WTF Stickers!" and go right to the nub of the matter?
Anyone else out there want to vote for Coding Condoms (TM(WTF))?
Admin
As a current student, I can only say that it's due to a culture of complicit incompetence. When I sit in the popular CS computer labs, it's not uncommon to hear a group of people agree that "yes, pointers to functions are too hard, and who needs them anyways?" or other similar tirades. I almost feel bad when my classmates tell me they didn't really understand an assignment proudly and I tell them that I didn't think it was unreasonable. Not everyone is like this, though: I am also a tutor for CS and see plenty of people who seek out help individually because they don't want to be stuck in a pit, although I should say that many more people are content thinking they know what they're doing when they can't tell their head from their ass.
I'm not claiming competence in all subjects.. I stumble around like a blind pirate walking on metal grating when I am in English classes, but I'm there to learn, not there to bitch about how "I'm stuck in a general education class and I don't understand why that symbolizes this and blah blah blah".
Admin
Just a point: If you're playing poker and you don't know who the sucker is, you're it.
If you write code and you don't EVER write wtf's, you mostly write wtf's. This is actually just a corollary of the basic principle: why does everybody else's shit stink so bad?
Admin
This is, of course, how most 'professions', particularly medical, started out; the regulation and so forth came later. Be patient, and it will come. Of course, a lot of trained professionals are incompetent in their subject area, too.
On this subject, I was a little unnerved at that recent US court case over the teacher who allegedly deliberately showed her students Internet porn; the 'expert witness' for the defence was a police officer who clearly had no clue as to what he was talking about. If I was charged with poisoning, say, I would hope that the state's expert witness was something a little better than a policeman who'd read a magazine article about homoeopathy once.
The best programmers I've come across have mostly actually been maths and theoretical physics graduates.
Admin
This site has taught me a thing or 2. Before I started reading things here, I didn't understand SQL-Injection at all, didn't generally worry about security that much, and generally any code I made (which isn't often as I'm not a programmer) was shockingly unreadable.
Since I've been reading here, I've turned around and now security is my priority. I avoid ugly hacks where possible, and make sure any I do need to use are done as cleanly as I can with plenty of testing. Sadly, I work for a government organisation, and the people in charge of our largest systems really need most of their work posted here :(
Admin
We should be doing something beyond pointing and laughing. We should try to educate those blissfully unaware developers stuck in WTF-land, too. Actively engage the developers or teams who wrote that WTF code. Help them understand what WTF code is. Help them move a few rungs up the skill ladder so they can avoid writing WTF code in the future.
A few of the commenters seem to think I am attacking WTF or the WTF community. I'm not. WTF is doing its part by highlighting the problem in an amusing way.
Unfortunately, the types of developers who could benefit most from WTF simply do not-- and never will-- read this website. Individually, personally, we have to do more to reach out to these developers: mentoring, apprenticeship, user groups, peer pressure, code reviews, etc. Do whatever you can, whatever makes sense to you, but do something. Pitch in so the next poor sap won't have to deal with WTF code, or at the very least, can at least benefit from slightly less crazy WTF code.
We owe it to the profession we all participate in. But more importantly, we owe it to ourselves.
That's the premise.
Admin
Agreed. In the realm of life critical software, the standards are usually extremely high. They probably wouldn't be any higher under the circumstances prescribed by many here (they would just be much more costly).
While there's bound to be wtfs no matter what kind of software is being written, most the wtfs I've read come from standard business software (and the wtfs in life critical systems will usually be balanced by an extremely rigorous QA process).
Problematic software abounds, but it's no cause for government regulation.
Admin
indeed. i'm not sure how many of the commenters even understood the spirit of the article. most proceeded to go right on being really negative about the bad code/developers/phbs/whatever/life they have to deal with.
Admin
Admin
I'll second that. It's funny, I'd never really thought about it, but it's spot on.
To the author of the article itself: don't take it so seriously! In every industry where things are made, things are made badly quite often because of a mixture of incompetence and hurry. Take a minute and ask a plumber or an electrician about the bad work he's seen others do, and had to work with - this is not an IT thing.
When I see bad code, which is often, it doesn't actually cause me physical pain. In fact it's quite amusing, and I quite enjoy rebuilding these WTFs when I find them and see fit. It's quite satisfying.
It would be nice if businesses and managers appreciated this sort of behaviour more and made budget available for it; I think a little re-education up there would be a good idea (but as always who are we to do it? What do we know about business? - and yes, that's sarcasm).
But really, it's no big deal. I could be wrong but I think most professional software developers would agree that WTF code is generally a slightly irritating but actually often quite amusing phenomenon and the Daily WTF - sorry, WorseThanFailure - is a way of collecting this not as some tool for the mass-re-education of developers but more just to concentrate that amusement in one place. WTF code is always funnier and less painful when you aren't the poor chump working with it :)
Anyway that few ideas -> many words criticism is getting progressively more applicable to this comment so I'll not go on. Let's just say I think of WorseThanFailure as a humorous site, it makes me laugh, I don't find it depressing. I think the author of this article takes life too seriously.
Admin
One of the most obvious pieces of bad code is the captcha here. You'd think they'd replace the familiar list of words with something better, but no. Turn the funny stuff into something non-repeating and generated like xAy28VVZ.
Since those are neither exciting or funny you'd get a lot less people repeating them.
Admin
That's funny zzz, the captcha on this comment is a random string of characters: "Papadimoulis"
Admin
This article and the thread of comments it has spawned reminds me of one simple realization I have come to in my few short years(8) in this industry.
There are 2 major paths for any "programmer":
Designer: Designers deal with users and management and translate English to "logic" and transmit it to coders. The translation is often accomplished using a sixth grade foreign language introductory course education.
Coder: produce something that the designer agrees to throw at the users and management.
This line is seen, highly visible and accepted. There needs to be people that do both. The problem is the split in coders.
2A) Code monkey: Great debuggers. Like a kid playing doctor wrapped from head to toe in gauze, code monkeys are great at taking a bug that the end user has reported and wrapping it in enough code to scare any doctor. These people are concerned with quantity(number of lines written, number of products released, number of bugs "solved"). The end result is the users' perceived bug has been replaced with something only a coder would recognize as a bug. The same methodology is used when "developing" new software.
2B) Code artist: Horrible debuggers. Like a renaissance artist forced to paint your house eggshell white, code artists will explain the deeper meaning and solve structural problems with your house, make it more comfortable, more appealing, and you'll be awed and inspired by it. It won't be eggshell white and it wont be done in one day. New software, like any piece of art will have a central theme and lines that seem to mesh in some way that makes coders pause for a moment. To most people, it looks like "modern "art"" looks like to me.
There are finer definitions and variations in those categories, but by and large, you know what I am talking about. It takes many colors to make that fine shade of gray we all cringe in horror about... released software. Let's be honest, the industry isn't in peril, it's simply that no one like the composition of their team(GIVE ME MORE MONKEYS!!!!) or the composition of the teams they look at.
side thought: Most WTF's can be explained by which side of what line, the author, the submitter and the reader sit on.
Admin
Am I the only one whose first thought was: "lighten up, man"?
Admin
They don't read the specs for the code properly, why would they read the article properly?
Admin
Hey Alex, How about keeping hippy huggy-feely pricks like Atwood off your site, eh? I come here to read about other people's mistakes, not hear some tree-hugging touchy-feely bullshit from a guy that can't open his fucking eyes to the realities around him.
-Boo
Admin
This wasn't funny or thought provoking. I think you should avoid such posts on this site.
I did find the content linked to Don't Make Me Think, both funny and useful. Invite Steve Krug to post next time.
Admin
Hmm. He seems rather more interesting than you, to be honest. Perhaps it is you who should be kept away?
Admin
Admin
Admin
Admin
I can see you're the kind of programmer that codes first then patches the patches later, all while the original promises go undelivered. Perhaps that's eight years of repeating the same three months?
Admin
Admin
Examining bad code and explaining how it can be better is a very helpful way of teaching. In fact, I wish WTF did more of the "how it can be better" bit.
I think Code Smells, as described by Martin Fowler and Kent Beck in the book "Refactoring", Joshua Kerievsky in this book "Refactoring to Patterns", and on the C2 wiki and elsewhere on the web, should be part of the education of every serious software developer, along with Design Patterns and Refactoring.
There is a value in showing bad examples and contrasting them with good examples -- they are much more concrete than abstract concepts like "cohesion", "coupling", "encapsulation", and so on.
Admin