Color Commentary

I recently spruced up some old parsing code that I wrote a year ago and found a comment that made me laugh. Insipred by this, I grepped through my code base and pulled out a few funny comments.

These aren't representative of my normal coding style, and are mostly from one-off scripts that I was never planning on using again. (We write a lot of those in bioinformatics). There's also a high likelihood that these were penned late at night.

# is this distribution actually skewed, or am I crazy? --- # This is rather inefficient, don't use it on million-item arrays any more --- # have to manually run this twice, once for gains and once # for losses. why? Because I'm lazy. --- # bah - this could be abstracted better - but for now, let's get it working --- # Is this code elegant? No. # Does it work? Yes. --- # yeah, yeah, global variables, I know --- # This is a hacky workaround. I really should # have designed this better --- # this script is an example of how NOT to write code. # It contains redudancy, global variables, confusing var # names, etc. But goddamn it, it works.


Written by Ben B -

Nice. I think my favorite I've come across in my own (inherited) code was where one person had previously said something like, "this method is pretty screwy, but heres what we're trying to do..." then another person wrote a comment under that saying "well if you think it's mangled now just wait till i'm through with it." i think i ended up rewriting a good bit of that method...

comments powered by Disqus