3 ms·
Right. And it's not just that the typing is static, but that you are using it properly. Cf: struct price { int value; }; struct quantity { int value
by dllthomas 12y ago
Right. And it's not just that the typing is static, but that you are using it properly. Cf:
struct price { int value; };
struct quantity { int value; };
int placeOrderUnsafe(int price, int quantity);
int placeOrderSafer(struct price, struct quantity);
...
placeOrderUnsafe(quantity.value, price.value) /* does the wrong thing */
placeOrderSafer(quantity, price) /* caught at compile */