Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Just got my first bad taste of spaghetti (code)...
So I work for a direct mail company and I do their programming for them. I've rigged up several little file convertors and data input systems using Rails.
Today I come in and my boss asks me to check out the file analyzer system that the guy here before me wrote in PHP. Basically it lets you upload a file and then it'll go through and spit out a sample of the first 10 or so records and also give stats such as what records contain the biggest fields.
All he wants me to do is make it so that instead of showing a sample of the first 10 records, also to show a sample of the very last record. I think, no problem...that's just not that hard. Boy was I wrong.
I open up the PHP file that does the work, and I immediately notice that this sucker contains everything...PHP, CSS, JavaScript, HTML, you name it. Alright, not that big of a deal. I'm not real familiar with PHP, but I've become a pretty decent programmer over the next few months, so I figure it shouldn't be too hard to figure out what part of the file displays samples.
So I find it and I edit the code around to where the row number is the very last record. Okay, not so bad. Then I try and actually display that record. I get nothing but an empty row doing that. Hmm...so I look around, and as I suspect, only the first 10 records are being read out of the file. Not a problem, I'll just change that value. So I set the number of records to be read in to 9999. Hey, it worked! Oh, wait...not only did it read in those records, but it also displayed all 9999 of them.
Great. Back to square one.
I've met the guy in real life and he's literally a genius. That sure didn't stop him from writing some mean spaghetti code. Wow I finally understand the frustration that programmers express for it.
0
This discussion has been closed.
Comments
Lucky for me it was a freelance job and I was getting paid by the hour
Especially when you already have a framework you can use to get going quickly