Hacker News new | ask | show | jobs
by collyw 4623 days ago
So what is the advantage of this approach over having a comment beside it? Sounds slightly more complex to me.
1 comments

Because comments can lie.

Also, it can be harder to express the generator in a useful way in English than the code itself if the code is well written.

The purpose is to make the code as clearly self describing as possible. I would only do it if it made the code read more like a human language and remove too much complexity from one place.