3 ms·
I don't think you understand Dart's type system. It has “dynamic”, which is equivalent to “any”! Dart's type system is worse because you can pass in null for a
by simplify 8y ago
I don't think you understand Dart's type system. It has “dynamic”, which is equivalent to “any”!
Dart's type system is worse because you can pass in null for any type at any time. This circumvents any sense of type safety your method signatures might suggest. It's no better than Java.
- andy_ppp 8y agoI have used Dart's type system and prefer it to Typescript because it's much simpler and better integrated into the language. I think "dynamic" is better than "any" because the type is inferred by dart which gives more type safety than Typescript does here. Obviously TS won't have a clue what to do after an "any" is passed into another Type afaik? You are right that that checking for nulls is a bit weird but you just set default values using ?. and. ?? and get on with your life - it doesn't make the whole type system bad and there will be attempts to fix this in the future.