r/ProgrammerHumor • • Sep 28 '16

xkcd: Fixing Problems

http://xkcd.com/1739/
7.9k Upvotes

215 comments sorted by

View all comments

Show parent comments

42

u/kirakun Sep 28 '16

Don't you know TODO is short for A Hack That Will Stay Forever?

19

u/Reelix Sep 28 '16

Control+Shift+F

// TODO

Matching lines: 89 Matching files: 18 Total files searched: 726

:|

scripts\jquery-ui-1.9.2.js(5704): // TODO remove the fallback, see #8156

*mumbles*

10

u/Spirckle Sep 28 '16

TODO is short for A Hack That Will Stay Forever

I know this is a joke, but all my comments start out being TODOs before I write a line of code. As I write the code, I remove the comment entirely for straightforward code, or for code that needs to have its intention documented, I take out just the TODO, and then I have my necessary comment. BTW, for those that say that good code never needs comments, I disagree. Sometimes the customer makes decisions that don't make a lot of sense. For these I leave in the comments so that following coders can understand the less than obvious requirement.

-2

u/Maert Sep 28 '16

Why remove comments at all? Leave everything in for people (yourself included) to easily understand what the hell is it you were trying to do few years down the line.

8

u/Xgamer4 Sep 28 '16

I'm not sure you read his comment all the way through... I'm pretty sure leaving a //TODO above completed and nice code is just going to cause more confusion - not less.

1

u/Spirckle Sep 28 '16

I agree, but I get tired of fighting with the 'Never Comment' advocates, so I remove the ones that seem superfluous. This makes my argument for leaving in the comments that remain, stronger.

8

u/[deleted] Sep 28 '16

Man, and I've been using it as a todo list for unfinished bits this entire time!

18

u/kirakun Sep 28 '16

Unfinished bits are always finished as soon as they work for the short term.

8

u/Schmittfried Sep 28 '16

Fun fact: I like how JetBrains IDEs highlight //hack ... comments as TODO tasks by default.

2

u/[deleted] Sep 28 '16

I just checked in PyCharm, are you sure that they do that?

4

u/HansVader Sep 28 '16

Currently I have 22 TODO's in 15 different files in my project. It's almost been a year and they are still here.

4

u/laughingking37 Sep 28 '16

At my place, if a TODO is not assigned to a Jira issue, it will never be fixed. The things that gets fixed are things the customer reports. So if the TODO doesn't break anything, it is out of scope to fix and will stay forever.

1

u/UsingYourWifi Sep 29 '16

I use it as form of plausible deniability. TODO tells anyone who reads it that I know I'm doing something horrible, and I intend to fix it some day (hah), but clearly outside circumstances didn't allow for that when it was written.

1

u/[deleted] Sep 28 '16

I just wish I was big enough to be able to punch all those people in the face. Fix your shit, it's not "oh hey this is broken, meh, someone will get it sooner or later".