4 ms·
The lesson is rather that optional static typing is useful. The programmer should be able to choose based on what makes sense for the task. Strictly statically
by TTPrograms 8y ago
The lesson is rather that optional static typing is useful. The programmer should be able to choose based on what makes sense for the task. Strictly statically typed languages preclude the option of going dynamic.
- logicchains 8y ago>Strictly statically typed languages preclude the option of going dynamic. No they don't; even in C it's possible to just type everything as void*, and everything as Object in Java. Just nobody does this 'cos it introduces a bunch of unnecessary runtime errors.
- yorwba 8y agoTo call a method on a void* or a Java Object you first have to explicitly cast it to a type that has that method, which means that you need to declare a common interface and have each object explicitly implement that interface. Duck typing in dynamic languages doesn't require that level of ceremony.
- emidln 8y agoThis is the lesson I've learned in Clojure. We have varying levels of data shape specification, contracts, and static type checking available a-la-carte when you want it but not getting in your way when you don't.