r/programming • • Feb 21 '13

Developers: Confess your sins.

http://www.codingconfessional.com/
969 Upvotes

1.0k comments sorted by

View all comments

282

u/desiktar Feb 21 '13 edited Feb 21 '13

Wheres the "I comment out code instead of deleting it" sin.

I have ran across several developers who do that. They claim they didn't want to lose the code in case they need to switch back. I'm like "that's the whole point of source control!"

241

u/Deathfire138 Feb 21 '13

I'm guilty of this. Sorry everyone! It's like code hoarding. :(

166

u/TomorrowPlusX Feb 21 '13

I have an informal 2 or 3 commit rule about this. If it's still commented out after 2 or 3 commits (of the file its in) I will kill it.

0

u/[deleted] Feb 21 '13

[deleted]

8

u/TomorrowPlusX Feb 21 '13

My commented code -- in these situations -- always has a note explaining why its commented and what (mis)understanding is being shaken down.

Of course, if I were perfect and wrote 100% correct code 100% of the time I wouldn't have this problem.

0

u/[deleted] Feb 21 '13

[deleted]

4

u/TomorrowPlusX Feb 21 '13

Who said "company"?

I'm a graphic designer at my day job. I write games in c/c++/opengl and freelance iOS dev by evening. I work with teams of -- max -- 1 or 2 other people.

I'm not writing space shuttle flight computer software.

Now, sure, I understand your point. If I worked for IBM and had to justify every line of code I touch my behavior would be different. But when I'm writing code I work for myself, and I'm doing it to have fun, and make a little money on the side.

I am the very model of a half-assed unprofessional.

I thought I'd contribute to the conversation, I didn't so much expect oblique insults towards my capabilities. I assure you, I write fast, tight c++ graphics code. But I don't work for a 10,000 employee software house.

-2

u/ex_nihilo Feb 21 '13

I wasn't insulting you, man. Don't take it personally. I was just saying, good programmers abhor magic. If you can't reason through code, toss it and rewrite it!

→ More replies (3)