Live data from Hacker News

Ask HN: What horrifying and/or terrible things have you seen in production code?

news.ycombinator.com

1–10 of 20 posts

Re: Ask HN: What horrifying and/or terrible things have you seen in production code?

#4
* Horrible duplicate code. * Functions with more than 200 lines. * Functions with about 16 parameters. * A deploy process that consisted of copy and pasting using FTP. * No source code control. Not even regular file backups, the 'code' was just on production and everybody worked against that. * If else cases in the double digits.

Re: Ask HN: What horrifying and/or terrible things have you seen in production code?

#6
Upon login, an application that created a new database for the user and then imported ALL the data from the api before allowing the user to continue to the next screen. The database would be dropped upon logout. Login times were in the hours if it was successful at all.

And now think about the security and data integrity problems that implies.

Re: Ask HN: What horrifying and/or terrible things have you seen in production code?

#7
I've seen many things in my 10+ years of coding, Here are some favourites:

* No authentication check on any page after login page. (You could type in any URL in browser address bar and gain access).

* GET request updating home page related content in database. (A few of these GET request was picked up by Alexa bot and we hard our home page content change randomly for many days. We had a real hard time troubleshooting this one).

* Use of mysql_query() in PHP. (Deprecated mote than 10 years ago. Opens doors for SQL injection).

* Use of loop variables i,j,k,l,m for 5-level nested loop. (Too error prone and difficult to read).

* Unit testing applied to a highly monolithic code. (The hacks for isolating code units produced more garbage than the code itself). It was a legacy code and the management blindly ordered writing of unit tests when a few bugs were caught in production.

Re: Ask HN: What horrifying and/or terrible things have you seen in production code?

#9
I used to do quite a bit of troubleshooting/rescuing half finished projects, or live things that had no developer involved for one reason or another.

Not that many years ago I was still seeing people storing credit card numbers in plain text files on servers, and sending them unencrypted via email.

Re: Ask HN: What horrifying and/or terrible things have you seen in production code?

#10
A company for which I used to work decided to buy rather than invent some new technology. In this one case, after the principles had taken their money and run, I was asked to look at the IP that money purchased. This came in the form of 8 8" floppy disks (dating me:). At the time I was in a metrics MSc class, so I decided to write a comment stats program, and ran these disks through it. With a alarming result - precisely 1 comment. And when I searched it out, it was this:

"I don't know why this works"

Oops. After that they put me at the front end due diligence instead of the back end.

Post reply on HN