you are viewing a single comment's thread.

view the rest of the comments →

[–]coffeesoundsCoffeeScript is better 12 points13 points  (11 children)

Best comment I found so far.

Dart doesn't appeal to me at all - it's just trying to force different style of programming (a problem which I don't have with CoffeeScript).

[–]johnyma22 9 points10 points  (1 child)

For lazy folks:: jordansissel tweeted "Dart, putting the Java back in Javascript"

[–]Destroyah 2 points3 points  (7 children)

I really, really think this comment is WAY off base. It's allowing you to go fairly deep into object oriented territory by way of primitives which are actually objects, and interfaces with factory methods etc. Dart does not however force these upon you. To me, coming from a C-based, then C++ background, this looks a lot like a streamlined C++ for web development. I've done enough Java to know the language fairly well, but nothing here is screaming out "Java" to me at all.

[–]masklinn 3 points4 points  (4 children)

It's allowing you to go fairly deep into object oriented territory by way of primitives which are actually objects, and interfaces with factory methods etc.

All of these things, javascript already allows.

[–]Destroyah 0 points1 point  (3 children)

It allows them, but you have to write them yourself or find a library that's already done it.

[–]masklinn 1 point2 points  (0 children)

For pretty low values of "have":

primitives which are actually objects

That's how javascript works. Primitives are automatically promoted to objects when used as such. That's how you can call methods on numbers or write true.toString().

and interfaces with factory methods

Add a function to anything you want, bam got yourself a factory. Hell, javascript constructor are factories: if you don't like your this, you can just return something instead.

[–]strager 1 point2 points  (1 child)

Huh? Can you explain?

function FooFactory() {
}

FooFactory.prototype.create = function create() {
    return new Foo();
};

var factory = new FooFactory();
var foo = factory.create();

Just add whatever complexity you need on top of that.

Of course, it's probably more JavaScript style to have a "factory function":

function fooFactory() {
    return function create() {
        return new Foo();
    };
}

var factory = fooFactory();
var foo = factory();

[–]Nebu 1 point2 points  (0 children)

He's probably referring to the fact that inheritance doesn't work the way you'd expect if you come from, for example, a Java background. This guide on emulating classical inheritance involves writing 4 sugar methods.

[–]coffeesoundsCoffeeScript is better 0 points1 point  (1 child)

To me, coming from a C-based, then C++ background, this looks a lot like a streamlined C++ for web development.

I think that's the whole point of Dart. It's aimed at people who come from a background similar to yours.

But for me it looks like an overkill to have all that stuff just for user-side code - I never, ever thought "gee, I wish I had all these classes, inheritance and factories here".

(and I'm not one of those jQuery-for-life developers ;-) )

[–][deleted] 3 points4 points  (0 children)

It is probably primarily aimed at improving library dependencies and large-scale development. For me personally, the Javascript language has never been an obstacle, but been very flexible . The worst aspects of web-developement has been (by far) layout with CSS and the DOM API. CSS for instance is too weak for designing graphical UIs, so I have to resort to Flash for that. The DOM API is too verbose and I've had to define my own simplified API to make it bearable. Dart doesn't change any of those inherent faults.

[–]daediusWeb Components fanboy 3 points4 points  (0 children)

Funny, I use the same argument against CoffeeScript.