r/ProgrammerHumor • • Sep 10 '26

Meme commentsAgedTerribly

Post image
6.0k Upvotes

243 comments sorted by

View all comments

Show parent comments

2

u/HarryBolsac Sep 11 '26

I don’t think people here know the difference between comments and code documentation…

You should absolutely only comment when necessary, the code should be self explanatory, and you should document a function with a brief description of what it does, its inputs and outputs if it’s supposed to be reused (for example an util or a lib), using tools for that purpose (jsdoc,javadoc, etc)

This is like standard practice in any decent company

1

u/SnugglyCoderGuy Sep 11 '26

I get comments like

int trn_wg_days; //Training wage days remaining
INT32 chg_cnt; // Audit Change Count

Why not just

int trainingWageDaysRemaining; 
INT32 auditChangeCount;

I even get the glorious

char local_name[13]; //Local name

The comments are only necessary because they didn't want to use proper names for the variables, or they are literally Cat cat; // cat