DEV Community

Discussion on: Do Code Comments Deserve a Special Spot or Can Well-Written Code Speak for Itself?

Collapse
 
ephilips profile image
Eesaa Philips

Absolutely. For example, our groovy backend integrates with Odoo ERP using xmlrpc. For some reason, it expects an extra level of nesting for its filters. If you look at the code, it looks like the developer is just nesting objects in a list for no reason, so a comment explaining that this is required with a link to the docs gives the reader context.
I think people who say "code should be self-explanatory" have not written complex systems which inevitably have peculiar behaviors and baffling quirks that you simply cannot explain without a comment.