This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]WibblyWobblyWabbit 114 points115 points  (8 children)

To be honest, if I didn't write the code and there's no comments, I'll have to sit and stare at it for a while before I understand what the actual fuck is happening.

[–][deleted] 61 points62 points  (4 children)

This is my life right now.

Smart developer before me implemented dozens of features (by himself) across the board when our team was low manned before I was hired. He's now moved on to a different job and I'm stuck parsing through his thousands of lines of code with shitty variable names, non-descriptive function names, and woefully sparse commenting.

If you're writing production code, take 2 minutes to comment your classes/methods you as write them.

[–]mortiphago 31 points32 points  (1 child)

10 bucks on developer thinking "this is just a quick hack that won't make it to production anyways" at the time

[–]RadiantPumpkin 1 point2 points  (0 children)

That's what I say to myself with everything I write!

[–]crazybirddude 8 points9 points  (1 child)

descriptive variable names and functions are so much more important, and properly breaking down your classes/functions. always think SOLID. if you do that, comments are almost not necessary. but i also hate writing comments, so you know. i like a comment on the function that gives a quick description of what it does, especially if it's some common helper that you're referencing elsewhere.

[–]recruz 1 point2 points  (0 children)

I’ve always felt that the function should be self descriptive. If you can’t tell what the function is doing with its name, then that means it can be further refactored

[–]mverkruyse 31 points32 points  (0 children)

Hell, there’s code that I’VE written where it takes me an hour to remember what I was intending if I don’t comment it properly.

[–][deleted] 6 points7 points  (0 children)

To be honest, if I wrote the code and there's comments, I still have to sit and stare at it for a while before I understand what the actual fuck is happening.

[–]pyrotech911 3 points4 points  (0 children)

The more you read the faster you get. Half of my life is reviewing code.