4 ms·
That all makes sense, but it's disappointing to see that Dart is no better than Java in type safety. Every type is nullable (the billion dollar mistake), and th
by simplify 8y ago
That all makes sense, but it's disappointing to see that Dart is no better than Java in type safety. Every type is nullable (the billion dollar mistake), and the type system is too weak to support mildly advanced data modeling without requiring heavy OOP.
Dart is a pain to work with. But to be honest, Flutter makes it worth putting up with.
- hajile 8y agoNon-nullable types are in the works. I'd love for Standard ML to become popular as it offers all the things in a pragmatic package. The ML languages (and their hindley-milner roots) have sat around for over 45 years without being adopted into the mainstream. At some point you have to admit that the world isn't ready for a great language yet and go with something that is a step in the right direction. If I have to use a lowest-common-denominator language, I'll take Dart over Java any day. The syntax is better, first-class functions with closures are far superior to anything Java offers, decent type inference, etc are all steps closer to SML and make life easier.
- pjmlp 8y agoAre you comparing Dart with Java 8?
- hajile 8y agoEDIT: 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.
- deleted 8y ago[deleted]
- simplify 8y agoI'm not comparing Dart to an SML. If you want something to compare to, TypeScript is the pragmatic package you're looking for. It makes major steps in the right direction.