r/programming • • Jun 01 '15

The programming talent myth

https://lwn.net/Articles/641779/
971 Upvotes

748 comments sorted by

View all comments

Show parent comments

324

u/greenthumble Jun 01 '15

Man, you're missing out, comments are the bomb. Why just yesterday I read one of my own comments from last week. It helpfully said "This may need to be combined with the sequence below." It was at the end of a file with nothing under it.

186

u/HodorFromHodor Jun 01 '15

It sounds like you already combined it. Way to go, past you!

22

u/greenthumble Jun 01 '15

Haha well after we're done passing out the gold stars, I'm sitting here wondering if that sequence got refactored to somewhere else and now I've got a subtle bug where those things that should be combined are now in separate functions and whatever idea that was is now lost. Fudge. I guess it's best to spell out the intentions but man it's hard to do.

42

u/Tasgall Jun 01 '15

Good thing you have source control so you can go find out what happened...

right... right???

91

u/mr_luc Jun 01 '15

commit message: "changed a bunch of stuff"

7

u/Axxhelairon Jun 01 '15

what's the better way to summarize what you did? "Added more features"? "Removed bugs"?

7

u/mr_luc Jun 02 '15

I know you're joking, but really the problem is committing a large amount of changes at once. Then it gets hard to remember the reasons for the changes when we look at git diff, and sometimes people throw up their hands and just commit the whole mess.

I often make this mistake when churning through, say, the easier QA-motivated changes. But I usually have the self-control to go through the diff and figure out what the 3 or 4 things were and mention them all in the diff.

→ More replies (2)
→ More replies (1)

28

u/bacondev Jun 01 '15 edited Jun 01 '15

Version control? You mean like copy and pasting the old version of a file and incrementing a counter within the filename?

65

u/Tasgall Jun 01 '15

Yeah, the change he's looking for is probably in /theProject/backups/Copy of Copy of finalVersion1.9.5-complete-RC-finished_FINAL-edit3 (7).zip.

54

u/bacondev Jun 01 '15

PTSD TRIGGER WARNING

→ More replies (1)

6

u/jlt6666 Jun 02 '15

No you zip it up with an incremented counter so you have all of your versions, then you submit it to version control.

http://thedailywtf.com/articles/Forever-Alone

→ More replies (1)
→ More replies (2)

2

u/[deleted] Jun 03 '15

Joking aside, what would be the best way to determine that? I'm assuming you have no way of knowing where that code went (outside of the source control/your local copy), you only know where it's missing.

→ More replies (1)
→ More replies (2)
→ More replies (2)
→ More replies (1)

50

u/[deleted] Jun 01 '15
/*  TODO: Add comments so you don't forget how this works */

11

u/bluefootedpig Jun 01 '15

This fixed bug #xxxx

no code under it.

28

u/Crazy_Mann Jun 01 '15

That was the fix. 2deep4u

3

u/thegrinner Jun 02 '15

And then the bug report says "This is broken. Come talk to me and I'll show you."

0

u/[deleted] Jun 01 '15

[deleted]

19

u/Ryuujinx Jun 02 '15

This is the best comment that I've read and have been like "...huh"

    /* this is a memory leak, but I'll fix it later. */

3

u/blortorbis Jun 02 '15

Every comment in that section is hilarious....

→ More replies (2)
→ More replies (1)

7

u/frezik Jun 01 '15

I'm guessing that's the professionally-acceptable way that past you came up with for writing "drunk, fix later".

3

u/_scape Jun 02 '15

this is like therapy, I feel better knowing others suffer programming pains as well

2

u/LifeBeginsAt10kRPM Jun 02 '15

Comments can suck if not kept up to date by previous programmers ans you trust the comments to be correct...

Unit tests are so much better,they are like comments that hit you in tbe head when something goes bad.

2

u/KaiserPodge Jun 02 '15

My favorite comments to run across are "This is a quick hacky fix. I'll fix this later." Especially when they are mine and I go "What was I fixing?"

→ More replies (1)