Saturday, June 11, 2016

Another one bites the dust.

So yesterday I was chilling in the computer room as usual when the guy next to me clicked the submit button and his executed his program, effortlessly giving out a wrong answer.

It would not be very notable, in fact, everybody does that on the first try, if not for the fact that he tried looking up a complicated formula for that same program on the internet. The original formula - the leap year rules - was given so that we could write a program to check what day of the week a given day is. His program was executing well until year 399, where his code must have miscalculated and gave out a wrong answer. Instead of reviewing his poor isLeapYear function, he decided to implement the Gaussian algorithm, which also ultimately failed horribly at year 5 or so, and after an hour of frustration, gave up.

It's pretty funny when we think our code is perfect and our algorithm is flawed, instead of acknowledging our fault. I have been this guy. I may be him some time in the future. No one can be sure. This is simply a reminder. Don't put your pride on your incompetence.

No comments:

Post a Comment