4 ms·
what I and others have been saying for so long: that static typing prevents the bugs that are easiest to catch Not only are such bugs the easiest to catch, but
by stcredzero 12y ago
what I and others have been saying for so long: that static typing prevents the bugs that are easiest to catch
Not only are such bugs the easiest to catch, but they include bugs that can be insidious, expensive, and prohibit certain refactorings if they are not caught.
This isn't to say that static typing is the only way. It's more accurate to say: If you aren't catching those bugs automatically, you are doing it wrong.
- dllthomas 12y agoRight. 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 */