3 ms·
If you don't comment your code you're doing a disservice to yourself. Code comments allow me to understand how I was thinking about a particular problem when I
by whoisjuan 6y ago
If you don't comment your code you're doing a disservice to yourself.
Code comments allow me to understand how I was thinking about a particular problem when I wrote that solution. Without that context is way harder to re-establish understanding of my own code if I need to change or refactor something.
Something that I respect deeply, it's when I see a comment like "Here we use a global variable for this xyz reason. Global variables are bad and are discouraged but we used it here to get around something".
That level of self-awareness and scrappiness can only be achieved by contextualizing your decisions with a comment.
Sometimes bad code becomes decent code just by the merits of a comment that explains it.