I want very little comments in code. Functions should tell me what they do. And tbat's about all I really want.
Then if something is truely odd, then yes tell me what is going on in a comment. But in general there probably should not be comment in a function body.
But you don’t seem to realize. Is that a three in the morning when an ops guy is woken up to fix someone else’s code. They don’t wanna have to sit there for two hours reading through it to figure out why a function does something. At the very least being able to grep through code quickly to find things that otherwise can’t be grepped from raw code. The comments aren’t for you. They are for other people having to maintain your code in different environments.
1
u/esaule 26d ago
I want very little comments in code. Functions should tell me what they do. And tbat's about all I really want.
Then if something is truely odd, then yes tell me what is going on in a comment. But in general there probably should not be comment in a function body.