
Dart: Sound Null Safety - markdog12
https://medium.com/dartlang/announcing-sound-null-safety-defd2216a6f3
======
RivieraKid
I've been using Dart and Flutter recently, mostly happy with it, Dart got into
my top 3 languages actually (the other 2 are Swift and Julia).

Some random thoughts about Dart:

\- The design seems driven by pragmatism and developer experience. I hate
dogmatic approaches to languages (such as: FP is always better than OOP).

\- No REPL.

\- Two things I like about doc comments. First, they use "///" instead of "/*
*/". Second, instead of the Javadoc style where every method argument and the
return value must be described, in Dart the preferred style is to describe the
method naturally with no prescribed structure.

\- The formatter defaults to 80 characters, I think something like 105 would
be better.

\- Don't like the access control model where private members start with an
underscore, it's just ugly. It would be better if everything was private by
default and public memebers would be annotated with the "public" keyword.

\- Overall, it seems like poor man's Swift, can't think of any amazing feature
right now, but the whole experience is good, not too far behind Swift, better
than Kotlin, even though Kotlin should be better on paper.

And Flutter:

\- It's fun and easy compared to Android and iOS. (I haven't tried Swift UI
yet so can't compare.)

\- Iteration speed is amazing and a killer feature. I have the IDE and the
iPhone simulator side by side and with Cmd + \ I can reload the app in like
half a second.

\- You can't achieve truly native experience but you can get close. The
widgets don't accurately mimic native widgets. For example scrolling physics
on Android - it's just similar.

\- Performance seems reasonably good, native apps just feel a bit better for
me.

\- Flutter is the best technology for multiplatform mobile development IMO,
unless you want to share code with web - Flutter for the web is DAO.

~~~
hajile
> Overall, it seems like poor man's Swift, can't think of any amazing feature
> right now, but the whole experience is good, not too far behind Swift,
> better than Kotlin, even though Kotlin is more feature-packed.

It's actually the reverse. Dart was designed _before_ Swift and Swift seems to
have taken quite a few ideas from it. The "big" difference to me is tuples,
but Dart has the idea open under multi-value returns. Another big difference
is GC vs reference counting, but I think the GC is the correct choice.

I rather like the underscore for private variables. It helps remind me without
having to reference the top of the file constantly.

~~~
RivieraKid
Which ideas did Swift take from Dart?

------
yagodragon
Wow, they really listen to people's feedback. Looking forward to testing it
with a couple of small apps I have once it becomes stable. Overall, the
dart/flutter experience has been amazing for me. The team looks serious about
providing the absolute best developer experience and so far they've done it.

Flutter's future looks promising because it's also a first-class citizen in
the new Fuchsia OS. I don't know how's that experiment gonna end up, but even
today it can be considered one of the best UI toolkit we have.

------
wstrange
Kudos to the Dart team. I'm sure this feature was a super heavy lift.

"The soundness of Dart’s null safety has another welcome implication: it means
your programs can be smaller and faster. "

------
pram
What is Dart being used for these days? This isn’t snark I’m curious. I looked
into it a couple years ago but ended up going with TS for a project, it looked
pretty neat though.

~~~
sebe
Dart is used by [https://flutter.dev/](https://flutter.dev/) a Google UI
toolkit

Flutter's focus has been mobile apps, but they are working web and desktop.

Dart pad has some flutter demos [https://dartpad.dev/](https://dartpad.dev/)

~~~
_bxg1
Is it used for anything other than Flutter? I remember they initially pitched
Dart as a wholesale replacement for JavaScript on the web, before Flutter even
existed.

------
_bxg1
I'll never understand why people thought it was a good idea to design static
type systems that _can 't_ express nullability/non-nullability in the first
place. In a Java codebase every single object reference is a potential land-
mine, and the only way to be totally safe is to add a null check before every
single access or method call. So most people just roll the dice until
something inevitably breaks.

------
exclipy
> Dart shares sound null safety with Swift, but not very many other
> programming languages.

What about Kotlin and Rust?

