DEV Community

Discussion on: Don't document your code. Code your documentation.

Collapse
 
miniharryc profile image
Harold Combs

Amen.

The pendulum swings. In college, I was taught to comment everything because "that's what industry will expect." Getting into industry was quite a shock, needless to say.

I heartily agree your code should be readable, and "say what it does."

Sometimes, it needs to do something....odd. The WHY for that should be a comment.

External documentation has its place, particularly for how to get someone else set-up on developing the module, and code examples for idioms.