3 ms·
> The scope is to understand what the function does from its name, arguments list and the way it is invoked. Good names mean a great deal, but this is too much
by mannykannot 10y ago
> The scope is to understand what the function does from its name, arguments list and the way it is invoked.
Good names mean a great deal, but this is too much to expect from them. Understanding what a function does includes issues such as its time complexity, whether it is thread safe, what (if anything) it modifies, what exceptions it might throw and what exception safety guarantees it honors... And there may well be specific corner cases - for example, in a function with 'find' in its name, what does it do if there are zero or multiple matches to the key being sought?