site-www icon indicating copy to clipboard operation
site-www copied to clipboard

Expand documentation of `late` considerations

Open parlough opened this issue 1 year ago • 1 comments

I'm not exactly sure what this will look like yet, but I've been seeing a few misconceptions of the late keyword. The following are some common points of confusion or topics not well understood.

  • When late is and isn't necessary
  • What late means in different contexts
  • When late can be unsafe
  • How late (variables) could potentially interact with other language features:
    • cascade notation (https://github.com/dart-lang/linter/issues/4873)
    • immediately invoked anonymous functions (https://github.com/dart-lang/site-www/issues/4613)
  • Late fields vs nullable fields
  • When a factory makes sense instead of late fields

If anyone has experienced any confusion around late themselves or seen it, please feel free to share as a comment here! I'd really appreciate it and it'd be super helpful to future Dart learners. Thanks!

parlough avatar Feb 11 '24 03:02 parlough

Pretty sure I meet the target audience criteria and I just wanted to say the points you raised already are very in line with what I would consider helpful under the larger umbrella of learning when to reach for it, when not to, what my alternatives are and the tradeoffs I should consider.

bivens-dev avatar Feb 11 '24 22:02 bivens-dev