3 ms·
Isn't Clojure dynamically typed by default? That would seem like a major difference to Java. Or is enterprise Java effectively dynamically typed as well, so th
by fweimer 3y ago
Isn't Clojure dynamically typed by default? That would seem like a major difference to Java.
Or is enterprise Java effectively dynamically typed as well, so that the language-level difference matters less? I had only very limited exposure to JEE, and was surprised how much that was nominally unchecked at the Java language level was effectively type-checked by the JEE platform. But maybe this falls apart for non-toy projects?
- tormeh 3y agoJava doesn't have macros, so everyone uses reflection. That moves errors to run-time. Add to that the typical enterprise patterns like dynamic dependency injection and you end up with very dynamic deployments.
- fweimer 3y agoI understand that. The build environment I used had type-checking for CDI annotations, obviously outside of the Java language, if I recall correctly. If the types did not line up, the build would fail. This was part of some JEE training I took out of curiosity, maybe real-world JEE is different?
- roenxi 3y agoClojure is statically typed - in practice everything is a java.lang.Object. Checkmate, type system enthusiasts >:D. Except macros, I suppose. If you try to pass function arguments that aren't a Java object or primitive IMO it won't work. [0] More seriously, if you want something with type T, Clojure can give you something with type T. It understands types. Doesn't respect them, but it understands what it is ignoring. It isn't trying to replicate Java, but it has all the tools to replicate Java if necessary. [0] The author acknowledges that this paragraph, while true, is unhelpful. It is offered in a wry tone.