dart-lang/site-www

Update language tour for Dart 2 changes

Closed this issue · 9 comments

I'm working on the strong mode changes, which are pretty invasive.

This is so awesome to see!

I don't know how to update the language tour for fuzzy arrows, so I'll be contacting @leafpetersen. We expect to start using implicit new/const everywhere for beta 3.

We should cover asserts in initializers (and probably beef up the initializer coverage a bit).

I'm starting on removing new and const.

I'm starting on removing new and const.

There is a PR pending for that: Remove all uses of "new" and "const" from "Effective Dart" #844. In particular, note this comment: #844 (comment). If we have the green light to go ahead with this, then great!

I'm starting on removing new and const.

There is a PR pending for that: Remove all uses of "new" and "const" from "Effective Dart" #844. In particular, note this comment: #844 (comment). If we have the green light to go ahead with this, then great!

Because Flutter's style (at least within constructors) is not to use new, I've been asked to avoid new whenever possible. The bar for Effective Dart is higher, because it sets conventions used everywhere. (I suppose you could say the same for the language tour, but it does cover new, and I don't think people copy-paste its code as much as they do from more focused docs.)

Implicit new and const are covered. I don't think we need to cover fuzzy arrows, but I should probably still add an example of an assert in an initializer.

#677 added an example of using assert in an initializer.