The worst comment I’ve ever written

I’m sitting here trying to debug a very complex piece of “meta” code. This code generates web forms that have fields that automatically show/hide based on the selections in other fields. It’s usually very nice to work in, and it makes creating dynamic forms easy, but it is insanely complex under the hood. I finally find the source of the bug is a hip, railsey, ruby one-liner. It’s not to hard to figure out what that line does (adds some kind of prefix to each key). However I have no idea why it would do that. Luckily when I wrote this code I knew this was confusing, so I included a comment:

if (@if)
#in case this is being rendered in a subsection, the key
@if.each {|andor, array| array.each {|h| h[:key] = field_name_prefix + h[:key] }}
end

Except I forgot to finish it. The key…. the key….. WHAT ABOUT THE KEY YOU IDIOT?? This is the worst comment I’ve ever written. It is worse than no comment. No comment wouldn’t have got my hopes up….and then crushed them. Why isn’t it lunch time yet?


One Comment on “The worst comment I’ve ever written”


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.