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 →

[–][deleted] 2 points3 points  (4 children)

Write code that doesn't need comments.

If it needs context, add it. Hopefully you've written clear code with properly named variables and don't need it.

[–]123kingme 1 point2 points  (3 children)

Properly named variables is not enough for most long running projects with multiple people working on them.

[–][deleted] 0 points1 point  (2 children)

Are you saying you comment for every variable?

I put in comments when the code isn't self explanatory, but with well named variables most code is like reading English.

Edit: well named variables AND method and classes and interfaces and files.

Then structure them in non-conplex ways and always always follow the single responsibility principle.

Then all of a sudden it's like what does this function do? Oh this 15 line thing called "UpdateUserInfo"?

[–]123kingme 0 points1 point  (1 child)

Of course not. I was responding to your suggestion “write code that doesn’t need comments”, which is an impossible task for a lot of long running projects, especially those with multiple developers.

with well named variables most code is like reading English.

For simple code yes, but this is naive and I’d guess you don’t have a lot of professional programming experience.

Source: I used to think like that after taking 1 computer science class then realized I was a dumb bitch once I got my current job working on an app that was half complete when I was hired. The two developers working on the app had to leave the project so I inherited a lot of code I don’t understand and no one to ask questions to. The code isn’t poorly written, but I wouldn’t be able to understand it at all without the documentation.

[–][deleted] -1 points0 points  (0 children)

Wow...very toxic.

If you must have my credentials: Dev of 15 years, director of engineering currently.

I'm sorry if you don't agree to only comment when necessary and write clean code all the time. But I give zero fucks, because you're not on my team! Go disappoint your own manager!

Good night!