News for hackers. Stuff that matters.
Re:Dartium: Google’s New Dart Programming Language Comes to ... by spankalee on Thursday February 16, 2012 @04:51PM (#3600827)
> Does it support prototypal inheritance? (also great)

No. Dart has classical inheritance, which by the large number of classical inheritance libraries for Javascript, is still very popular even when prototypal inheritance is available.

I personally abhor prototypal inheritance. It's aesthetically unappealing, hard to reason about, hard to optimise, and turns what is usually a declarative pattern into an imperative one. When most people are approximating classical inheritance anyway, that's a big sign.

It's sometimes nice that objects can differ structurally from their class, but I've never found it that useful.

Re:Dartium: Google’s New Dart Programming Language Comes to ... by firefoxman1 on Thursday February 16, 2012 @04:59PM (#3600868)
Ah, you are right, it doesn't support prototypal inheritance.

"When most people are approximating classical inheritance anyway, that's a big sign."

Two things on that:

1. Most people (vast majority) learned OOP in a classical style, so that's what they're going to be comfortable with and will try to implement. It doesn't automatically mean classical style is superior.

2. You may want to check out the Klass library[1]. It provides a "classical interface to prototypal inheritance." So perhaps classical style is easier to use, but prototypal is better to have in the background.

[1]https://github.com/ded/klass

Re:Dartium: Google’s New Dart Programming Language Comes to ... by spankalee on Thursday February 16, 2012 @05:10PM (#3600915)
Why is it better to have prototypal inheritance? What real problem does it solve?
[deleted]
Re:Dartium: Google’s New Dart Programming Language Comes to ... by spankalee on Thursday February 16, 2012 @05:43PM (#3601052)
Sorry, I don't think you understand how OOP works. In classical inheritance, each object only contains its data and a reference to its class. The class owns the methods - they are not copied to every instance. Most uses of prototypal inheritance follow a similar pattern.
Re:Dartium: Google’s New Dart Programming Language Comes to ... by firefoxman1 on Thursday February 16, 2012 @06:13PM (#3601169)
I'm sorry about that. I misread an article that described the differences. I'm just going to delete that last comment...It's embarrassing.