6 ms·
Ask HN: Funniest thing you've seen in a codebase?
- BillFranklin 12y agoI found '// A mistake plus keleven gets you home by seven' today, bug right above it.
- jwdunne 12y ago"// SagePay is a bit of hack on my framework" Said framework also looking at lot like one big blob of hacked together tangle of PHP and HTML.
- ianamartin 12y agoA giant wall of ascii art that said very simply: "It is awful!"
- camhenlin 12y agoI feel like I should go back and do this to a lot of my old projects
- ianamartin 12y agoMan, I think that any stored proc in SQL that gets over a thousand lines deserves this treatment. This one proc was close to 10k lines. It was awful. I hated working on that damn thing. But it made me smile when I found that little Easter egg.
- tjr 12y agoI don't remember it verbatim, or even what exactly the code was doing, but something like: // And now ladies and gentlemen, we need a volunteer from the audience! // Yes, you there, please come up. ...allocate dynamic memory... // Now our lovely lady from the audience will enter this mysterious box! ...do something with allocated memory... // We spin the box around! ... do more stuff ... // And when we open the box, we see she has vanished! ... deallocate memory ... Amusing, I guess, but it really didn't contribute understanding to the code. This was in the middle of a gigantic avionics simulation program that was almost entirely uncommented and extremely hard to understand in the first place. The same code base also had an MP3 recording of this song checked into it: http://lyrics.wikia.com/Frank_Hayes:Threes http://lyrics.wikia.com/Frank_Hayes:Threes
- atwebb 12y agoParaphased but if(thingthatshouldneverhappen) {alert('Oh shit!');} Guess what happened in the middle of a regional training? At least it was easy to find for debugging...
- pepsi 12y agoNot in our code, but in a log file - while parsing a credit card number, the log states "determining creditcardiness"
- BillFranklin 12y agoI also remember someone from the early Google team wrote that the founders' code wasn't all that great. >One Google engineer from back then says the most remarkable thing about the co-founders' code was that when it broke, users would see funny error message: "Whoa, horsey!" http://www.businessinsider.com/larry-page-sergy-brin-are-lousy-coders-2013-10#ixzz3VWhAmsSY http://www.businessinsider.com/larry-page-sergy-brin-are-lou...
- n17r4m 12y agoNot super funny, but pretty cool/weird stuff in a project I inherited: app <- -> exports.setup = it in LiveScript seems to compile to (function(it){ return exports.setup = it; })(function(app){}) which is pretty crazy. Another one, just above some code making many deep monkey-patches to the Sequilize db driver: /* HOLY FUCK THIS IS THE SKETCHIEST THING EVER */ made me smile.