3 ms·
I think adding extra variables (functions, modules, …) with meaningful names for exposition purposes is qualitatively different to adding boilerplate. The extr
by Chris_Newton 11y ago
I think adding extra variables (functions, modules, …) with meaningful names for exposition purposes is qualitatively different to adding boilerplate.
The extra variable can establish a meaningful new concept, making the code more self-documenting and thus improving readability and maintainability. The value added is similar to grouping related concepts in a namespace rather than making everything global, or to adding well-chosen comments at key points in the code for a tricky algorithm. Most experienced programmers follow the same principle routinely when it comes to naming constants instead of writing literal values all over their code.
In contrast, I think “boilerplate” has connotations of something verbose that you must write every time you want to express a certain concept, even though it has no inherent value itself.