Mitigating bullshit (job stuff)
The old code was utterly horriffic. For example, instead of using sessions (which takes all of one line of code in PHP4) it used hidden form elements everywhere to pass session data around. Of course, for normal links this wouldn't work so all links were done as Javascript hacks which would treat a link like POSTing a hidden form.
Not to mention that the things being passed around were trivially-mangled forms of the username and password, and it was essentially doing a login for each pageview.
Most absurdly was how many SQL injection holes I saw, and how easy it would have been to spoof a session or to grab someone else's password. (Especially since the passwords are stored in plaintext on the server.)
So, when John asked me how it was going, I told him that I went ahead and used the old code, but while I was cleaning it up I ended up accidentally rewriting everything and made it way cleaner and modular while I was at it.
Comments
Anyway, the nice thing about crappy code is that you can come in, rewrite it and work wonders. I had one company I was contracting for thinking I was a complete and utter genius because I simply threw out the horrendous crap that performed horrible and replaced it with the sort of thing any decent coder would have done in the first place.