Thank you for using the term “Sausage Factory”
Sorry, but my answer to “what’s the worst code you’ve seen recently” will probably always be “this code we got from an Indian company we outsourced a project to.”
My code may not be great, but I’ve definitely seen worse…
Great article.
I think your use of the word hate is stretching it too far. Sure, we dislike our code and want to improve it all the time. But there needs to be some motivation to improve our code and that can’t start with hate!
Addendum,
In the begging there was the CRT. And it sucked. And its interface sucked, and its command line driven software sucked. And it’s 1, 2, 3, A, B, C menus sucked.
And the Xerox said; “There has to be a better way.”
And it gave birth to the mouse. And behold the mouse begat the GUI and the GUI was stolen by Apple. And Xerox said nothing.
Then Apple gave birth to Lisa. And Lisa was expensive. Too expensive.
Then Apple gave birth to the Macintosh. And the Macintosh was pretty and cute and far more powerful than a PC but similar to a Ferrari with a 2 gallon gas tank. And it was still expensive. And it needed its mother; Lisa for only Lisa could begat the Mac’s GUI. And only Apple certified priest of programming with Lisa at their side could breathe life into the Macintosh.
And the GUI was simple, easy to use and intuitive.
Then, the evil god in the Northwest, not content with 90% of the PC market, was determined to undermine everything the GUI had stood for…
An evil spell came upon the land, Windows…
Windows 1, like the early terminators in the rubber suits it stood no chance.
Windows 2, better than Windows 1 but still no cigar.
Meanwhile, the minions at Apple finally came to realize that they need other developers so third parties first and then, Apple released compilers so that the ‘other’ programmers could write the GUI for the Mac.
The evil kingdom was hard at work and finally, Windows 3 was release.
And all those enslaved to DOS shouted HALLELUHA; we have been saved by Windows 3’s GUI not realizing that it was just a fancy facade.
But this was the beginning of the GUI’s downward spiral into ‘the Abyss’ of user confusion and malcontent.
As Windows popularity increased it seemed certain that the Macintosh would be forever banished to a faraway place, the niche market.
And, as Windows market place grew, so did its software base, a little good and a whole lot of bad.
And the users were confused. And the users were frustrated. And the user’s managers were in denial.
And, like a virus, Windows morphed:
Windows 95
Windows 98
Windows Millennium
Windows ME
Windows 2000
Windows XP
Windows XP Service Pack 1
Windows XP Service Pack 2
Windows XP Service Pack 3
Windows Vista
Windows XP Seven
Each being touted as an ‘improvement’ over its predecessors, except Vista.
Not only did Windows morph, but both Microsoft’s and third party software morphed as well. Like the infamous Ribbon in Office 7.
And the users were even more confused.
And IT said ‘No one ever got fired for buying Microsoft…’
And Apple was saved by the music.
I think its healthy to be critical of one’s code, but if you hate your code and think it to be the worst you’ve ever seen that seems self-defeating.
I follow a rapid iterative development process, so if I find terrible code I wrote I iterate over it and clean it up, and next week when its still terrible I clean it up some more, and after a few months working on a project I’m normally pretty happy with the majority of my code.
Never be afraid to refactor, refactor the crap out of your code, if you break other code, well good that code was probably awkward and stupid because of your other ugly code.
In general I like my code, I’ve worked in enterprise software long enough to have seen far worse, and I think I’ve side stepped the “rockstar code god” complex that the other side of the spectrum falls into.
My code is no where near perfect, but it is not the worse.
Quote: If the worst code you’ve seen recently is yours, then you haven’t been reading many questions on StackOverflow.
Well, that’s true. There are some real shockers to be found there. But I’m doing my bit to help – my rating is all the way up to 76!!! That’s almost 0.1% as high as the top guy!!!(ad nauseum)
99.9% of the time the prepackaged software that comes with hardware is utterly useless or broken, however, I was pleasantly surprised by the software that came with my new Seagate hard drive. It was easy to use and did everything it said it would without and problems. For the first time in my life I was impressed with a piece of software that came with a hardware purchase.
Very well written post!
Not only I don’t hate my code, but I love it, no matter how crappy it is. It is this love what keeps me trying to improve it everytime I can.
I don’t think a hate attitude for something makes you actually a “good” anything.
The fact that you love your code doesn’t mean you think it’s perfect, the same way you can love other people even if they are not exactly the way you want (maybe an exaggerated analogy!). Being happy with what you do is not a mediocre attitude, if your happiness comes from the fact that you know you did your best.
Sorry Mac, all OS’s suck. All of them, no exceptions. Where is my copy of XTree Gold??
In a former life I worked on cars; crashed cars. We would call ourselves “hacks” as a right of passage (good frame straightening techs are years in the making). Anyone who wouldn’t call them self a hack, was really a hack 95% of the time. I find the same for software developers.
I am not sure if what you say is entirely helpful. The problem is that you make people feel good about the bad code they write because all the great programmers think their code sucks too.
So if I think my code sucks, I must be not so bad after all. I believe self-critisism is very important but as the saying goes (translated from german): “If my reputation is already ruined I can continue freely w/o any shame”.
What you are suggesting is collectively ruining our self respect as progerammers, but as a consequence we might just continue to write w/o respect for our own code and not even feel guilty about it.
You can’t really hate something with a passion until you have truly loved it first. It is true of divorce, it is true of software development.
well ive been working in an older website written in asp, old school asp in vscript, heres a few things that have struck my attention
- vbscript as a language has unacceptably large issues, scope is broken, explicit declarations is broken, objects are barebones, includes cannot be conditional etc etc … but worst of all…
-ive seen variables initialised in a file and then dimensioned (declared) in another included file (as a way of passing variables to code)
- implicit html generation
- ive seen code weaving between 3 files backwards and forwards, declaring variables in one file, then using them in the next subroutine asif … and all so casually, with no attempt to have any code structure.
- vbscript and html written inbetween each other without any structure, just a giant page of garble
- unbelievably bad logic flows, like ifs and elses written plain wrong, like ill delete parts of it because im so sure its unecessary, only to find that it was necessary for a use case the comes from another file completely at random and even though the functionality is completely different
- absolutely no commenting
- code replication … same function over and over and over …
its quite funny how bad the code is … I dont think I could write it that bad
Although to be fair, my 3am coding attempts are pretty WTF the next morning when i wake up
OMG Jeff! Nail meet head.
This makes the top 5 right next to “Cleaning Your Display and Keyboard”.
I /hate/ installing software. Thank god for VM’s to at least test all those nice fresh steaming piles.
For the most part I agree but I really like Canon’s ZoomBrowser software.
This post ranks right up there with your May 12th 2008 post on people who touch monitors. Good stuff.
@Eoghan - “Would you fly in a plane that was reliant on software you’d written to stay in the air?”
It depends. How much time did I spend writing it, and how well did I understand what it had to do?
I’m not a slacker, but if you give me an impossible deadline and tell me to cut corners, I’ll cut corners and anything else that gets in my way. Why? Because you’re the one ultimately responsible, not me. Just following orders, boss.
Do I like doing it this way? No. I’m a professional, and I’ll do the best I can under the circumstances. But if you don’t know the difference between professional and amateur quality, and you’re paying me the same either way, or worse, screwing me over if I act professional, then I think you get what you deserve.
I haven’t coded any code in a while now. I’ve reviewed several projects, so the worst I’ve seen lately hasn’t been my own. It is right up there with the worst I’ve EVER seen though. I looked back at some coding I did my first couple years out here in the wild. Embarrasing to say it had my initials by it.
I often curse my past self with vast invective, but I’m still not the worst coder it’s my misfortune to maintain code for. I worked with this one guy who looooooved complexity for its own sake but wasn’t a big fan of comments. Or doing things the same way twice. Suck.
I nearly wept when I used Google’s Picasa for the first time because I knew that my very best code would never be half so useful, pleasant and intuitive.
The only thing worse than knowing ur doin’ it wrong is knowing that it is POSSIBLE (if very hard) to do it right.