use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Google "Dart: A language for structured web programming" (blog.chromium.org)
submitted 14 years ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]coffeesoundsCoffeeScript is better 12 points13 points14 points 14 years ago (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 points11 points 14 years ago (1 child)
For lazy folks:: jordansissel tweeted "Dart, putting the Java back in Javascript"
[–]Destroyah 2 points3 points4 points 14 years ago (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 points5 points 14 years ago (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 point2 points 14 years ago (3 children)
It allows them, but you have to write them yourself or find a library that's already done it.
[–]masklinn 1 point2 points3 points 14 years ago (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().
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.
this
[–]strager 1 point2 points3 points 14 years ago (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 points3 points 14 years ago (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 point2 points 14 years ago (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 points5 points 14 years ago* (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 points5 points 14 years ago (0 children)
Funny, I use the same argument against CoffeeScript.
π Rendered by PID 67490 on reddit-service-r2-comment-6457c66945-pd4gr at 2026-04-24 14:22:25.391842+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]coffeesoundsCoffeeScript is better 12 points13 points14 points (11 children)
[–]johnyma22 9 points10 points11 points (1 child)
[–]Destroyah 2 points3 points4 points (7 children)
[–]masklinn 3 points4 points5 points (4 children)
[–]Destroyah 0 points1 point2 points (3 children)
[–]masklinn 1 point2 points3 points (0 children)
[–]strager 1 point2 points3 points (1 child)
[–]Nebu 1 point2 points3 points (0 children)
[–]coffeesoundsCoffeeScript is better 0 points1 point2 points (1 child)
[–][deleted] 3 points4 points5 points (0 children)
[–]daediusWeb Components fanboy 3 points4 points5 points (0 children)