5 ms·
The downside to this approach is it often doesn't survive refactors. People change the method signature, update call sites, and often ignore the comments. Named
by city41 5y ago
The downside to this approach is it often doesn't survive refactors. People change the method signature, update call sites, and often ignore the comments. Named parameters avoid this downside, it's a real shame named parameters are not more common in languages.
- emptysea 5y agoLinters can check for this sort of thing, for example Error Prone[0] has a lint[1] for this. Totally agree this is better to be in the language proper so we don't need this extra tooling. [0]: https://errorprone.info https://errorprone.info [1]: https://errorprone.info/bugpattern/ParameterName https://errorprone.info/bugpattern/ParameterName