Skip to main content

New site for Dart news and articles

For the latest Dart news, visit our new blog at  https://medium.com/dartlang .

Notes from weekly Dart language review

Posted by Bob Nystrom


Here's my notes from this week's meeting. As usual, the meetings are fairly low key as we move towards M1.

Instantiating abstract classes

We're starting to move code from interfaces to abstract classes. We noticed a nasty pattern some people were doing where they made a private factory constructor just to get rid of the default constructor so that a class couldn't be constructed.

We don't want people doing that. So, instead, we'll make it a dynamic error to instantiate an abstract class. (Abstract class meaning a class that defines an abstract method or is explicitly marked "abstract".)

This is already a static warning in the editor, but we will make it an outright error at runtime. If you relied on this behavior, now you'll just override any abstract methods with empty bodies or throws or something.

Kasper pointed out that we can always loosen this up later if the above proves to be problematic.

Markdown doc comments

We've generated a histogram of which markdown features are currently being used in doc comments in the repository. Markdown is so rich that we don't think we can specify everything, so we want to pick just the subset we use.

The plan is that this will be an appendix to the language spec. Specifying this means the Editor can parse doc comments and style them appropriately.

I pointed out that most of the docs in the repo were written before any markdown was supported, so they may not be a representative set. I asked that we also take a look at some of the newer Dart stuff on github, in particular dartlib and the web components stuff.

Cheers!