2 ms·
I agree, but the original article at dusted.codes hopes types will "prevent silly mistakes like multiplying $100 with £20". I don't know what that author would
by an1sotropy 4y ago
I agree, but the original article at dusted.codes hopes types will "prevent silly mistakes like multiplying $100 with £20".
I don't know what that author would think of multiplying $100 with $20, but my point is that this embrace of type systems is apparently not just about function interfaces; it also includes the operands of things like multiplication, and preventing that operation if the types are fishy.
- Izkata 4y agoFor better or worse hopefully they think the two examples the same. Using the example above, "multiplying $100 with £20" can be achieved just by making the better engineer a remote employee paid in pounds. It adds the exchange rate into the mix, so the math will change over time, but conceptually the math is the same as the "dollar * dollar" example.