3 ms·
The core issue is that now you’re calling a different function. A type system may help, but the fact persists. Type systems only catch changes in (args.length
by wruza 6y ago
The core issue is that now you’re calling a different function.
A type system may help, but the fact persists. Type systems only catch changes in (args.length ++ args.map(primitive_typeof)). I think that this issue is not with types or arguments, but with a loose naming and handling of dependencies and backwards compatibility. A theoretical author of toReadableNumber() simply ditched one function and introduced another one, in-place. Apparently they did that because there is no way in their project to fork, retain and maintain both. You may say that types solve 95% of this, but dynamic languages exist for a reason, and when you feel like using one or see an advantage in it, other techniques may be applied. We could resolve that by using semver on functions instead of modules (renaming them at import for convenience), but nobody does that. Functions are fundamental building blocks, they take your args, do their job, return results and may have a separate environment (not in js), but somehow they are not autonomous entities. In contrast, in a real world we use explicit versions of things: gtx 1060 6gb, iphone se, cat 6020b, and the same for their part numbers. Nobody specifies just “gtx” or “cat” in their package.xls.