3 ms·
> Even if not intended, someone else may assume your "documentation" function was meant to be generally accessible (i.e. an API), and call it that way. And the
by dragonwriter 7y ago
> Even if not intended, someone else may assume your "documentation" function was meant to be generally accessible (i.e. an API), and call it that way.
And then, suddenly, instead of a single use function that serves mainly for documentation and code organization, it js a locally resuable and locally reused piece of functionality. Which is a problem, ...why, exactly?
The only difference between a well-designed single-user function and a well-designed locally reused function is that the single, clear, and unit tested purpose of the single-use function isn't needed in more than one place when it is written. If that changes, why shouldn't it be reused?
- networkimprov 7y agoThat's what I'd call accidental API design. It might work, or it might lead to perdition :-) Refactor with a new internal and coherent API once it's clear that's needed.