junior dev: can you please give me an example of useful comments in my code?

Me: sure, good comments look like this ⤵️

@nixCraft

nixcraft's point here is simple:

there's certain kinds of code that if you touch it it will kill you

@benroyce @nixCraft

// Dear maintainer:
//
// Once you are done trying to 'optimize' this routine,
// and have realized what a terrible mistake that was,
// please increment the following counter as a warning
// to the next guy:
//
// total_hours_wasted_here = 42

Source:
https://stackoverflow.com/a/482129

#dev

What is the best comment in source code you have ever encountered?

What is the best comment in source code you have ever encountered?

Stack Overflow

@dusk @nixCraft

i like this:

// sometimes I believe compiler ignores all my comments

🤔