DEV Community

Discussion on: I love to document my code. Am I doing it wrong?

Collapse
 
annarankin profile image
Anna Rankin

I write code for Junior Devs since I'm a Junior myself :)

This is one of the reasons I love having access to less-experienced folks at work. When I find myself looking at some code I've written and questioning its clarity, I have often pinged it over to a junior or someone with a different context than I have and asked:

If you stumbled onto this logic in a file that does X, without further context - what would you expect it to do?

If I can make that clear to a second set of eyes without a plethora of comments, I consider that a big win and another step toward writing cleaner, easier-to-grok code.