3 ms·
EDIT: somehow submitted half-way through typing. Even comparing with Java 8, dart syntax is much better IMO. Java 8 type inference gets better, but still not a
by hajile 8y ago
EDIT: somehow submitted half-way through typing.
Even comparing with Java 8, dart syntax is much better IMO. Java 8 type inference gets better, but still not as good (Java 10 looks to be getting closer).
Java 8 type inference gets better, but still not as good (Java 10 looks to be getting closer).
Java lambdas are a joke compared to Dart. This stems from functions being first-class in Dart, but being second-class citizens in Java. Dart can handle a much more functional programming approach much more easily than Java.
Java closures only work with final variables while dart works with all enclosed variables. In Java, if I want a function to accept another function, I have to explicitly say that I accept a Lambda because Lambdas are special cases. With dart, I can accept any function that matches my expected types because functions are first-class. Another big difference is that Dart functions can be top-level. If I need a one-off function somewhere, I don't need to pack it in a class. I just make it and use it.
I also prefer Dart syntax because of things like private variables, implicit setters/getters, named parameters, async/await, no need for `new` keyword everywhere, implicit interfaces, generators, etc.
- pjmlp 8y agoJava 12 is about to be released.... And if we get started on supported OSes, available libraries, modelling tools, industrial vendor and IDE support, then it is a non-starter. This putting aside that Kotlin, Scala, Common Lisp and Clojure are also options on the JVM.