跪拜 Guibai
← Back to the summary

Don't Comment Bad Code — Rewrite It

The viewpoint comes from: Are the principles stated in the book The Mythical Man-Month still practical today?. Combined with daily experience, it feels very reasonable, so I added it to AGETNS.md first.

Comments should be used to explain the "why," not to compensate for obscure code.

When you want to use a comment to explain what a piece of code is doing, what you really should do is rewrite it so the code explains itself.