Shared publicly  - 
 
[Dart or AngularJS]

I've had a discussion with a colleague about this the other day and I'm still in a dilemma. Hypothetically, there is a web project.

As a developer who is comfortable and well versed in HTML and JS and one who has built several web apps the old-school way, the front-end is up to you and you alone, and you will be doing all the work by yourself. You're allowed to pick one of the two technologies you're clueless but curious about. You have the choice of using the project and opportunity to learn either +Dart or +AngularJS - two very ambitious and up-and-coming projects from the same company, neither of which works very well with the other, each of which has some notable advantages that can be caught up to with hacks and assisting tools in the other.

Assuming the project is going to be a high-read, low-write web app, something akin to a shopping portal, ebay or a news portal (thus with loads of reusable elements like "ad" or "news snippet" or "feedback badge"), which technology do you choose as the main driver of the front end, and why?

Pinging my Programmers circle - sorry if you feel spammed by this; please let me know and I'll make a note never to ping you again.
42
8
François Bacconnet's profile photoBrian Ford's profile photoDaniel Bächtold's profile photoJiří Špác's profile photo
64 comments
 
I have already started to learn angular.js, love it, have been approved in my agency and will be used in a near future for online shops. :)
 
I'm biased toward Angular; would be good to hear from someone with more Dart experience.

Do you already know JavaScript and HTML (and like them)? If so, I suspect Angular will be a bit easier for you to use. Otherwise, you might find Dart is more your cup of tea. If you have no experience with either, it's hard to say. Give both a shot and see!
 
This is something that is a little more than hypothetical for me... I'll never watching this thread develop... 
 
+Brian Ford The assumption is that the developer is comfortable in JS and HTML, yes. Good point, amended the question.
 
Angular! Dart wants to change what I already know.
Angular builds upon my knowledge, and gives it strengh!
Also, Angular plays well with future versions of html with support for components.
Oh, and it doesn't compile to anything, it's already JS
 
I wouldn't use dart for commercial stuff just yet. Hiring people in the future will be easier for angular. 
 
+1 for Angular. I haven't spent much time with Dart. I have only briefly looked at it. I spent some time with GWT back in the day, and it wasnt fun :) Since then I dont trust too many compile-to-JS languages with coffeescript being the only exception :)

Angular is natural for a JS dev once you understand some of the concepts of angular (scope, directives, services, etc). Think about when your app becomes popular and you need to hire more engineers. What would be easier to find? JS engineers or Dart engineers?
 
I enjoy angular and have never used Dart so I can't say which is better. Too bad you cant do polls on google+ wink wink
 
+James Doyle You can, by disabling comments and putting two of your own, one for each option, which people then +1 if they agree to any :) I also considered a google form as well as a +TypeForm form, but in the end went with a regular post because I wanted to hear people's opinions and the reactions of people to other people's opinions.
 
+Bruno Škvorc thats cool i didnt know that! but this is better if you want to hear the reasoning 
Seth Ladd
+
5
1
2
1
 
Great question, they are both solid options. As with many technology decisions, it's subtle and context specific.

1) Do you have a team of awesome JS developers, that know the language inside and out? Do you have a team more comfortable with OOP and come from a C#, AS3, Java background?

2) How important is tooling to you? Do you like an editor that helps you set breakpoints, step through code? Navigate to function, display class hierarchies? Refactor code?

3) Is building on emerging web platform standards like Web Components important to you? Dart's Web UI is build on WC and inspired by model-driven views.

4) Is scaling code important? Dart is designed to go from 10, to 1000, to 10000, to 100000 lines code easily.

5) Is pure number of 3rd party packages important to you? Of course, JS has more libraries if you go by total count. But Dart has a package manager.

6) Do you care about things like unit tests, mocks, collections, i18n, etc being built into the platform?

7) Do you care about internals like how the framework deals with dirty objects and change detection? Angular and Web UI from Dart are different here. Web UI uses @observable to mark fields or classes that can be flagged as "changed", where my impression is that Angular loops through all watched expressions.

8) Do you care about IE8 or below? Dart only supports IE9 and above.

9) Do you want your platform to give you polyfills out of the box? (e.g. requestAnimationFrame, Web Components, etc)

10) Do you like modularity from classes and libraries?

I'd recommend doing a spike with both Angular and Dart/Web UI. Have a discussion with your team. Contact both the Angular and Dart teams with your list of concerns, see which community offers the kind of support you need.

One thing I want to be clear about: Dart is all about HTML. So much, so, that there is a very clean dart:html library that makes programming the DOM feel like Dart. For example:

var div = new DivElement();
div.text = "I'm a div!";
div.id = 'the-div';
div.classes.add('important');

But you can always use method cascades:

var div = new DivElement
  ..text = "I'm a div!"
  ..id = 'the-div'
  ..classes.add('important');

So an HTML and JS developer should feel at home with Dart.

And then, Dart goes farther and implements Web Components for all modern browsers. So you can build with custom elements and compile them to vanilla HTML and JS. So, <x-fancy-button> is a reality. :)

One assumption that I'm making, and most of us should make: you're OK with some sort of build step. Anyone releasing a production web application today has some sort of build step, to compress, minify, etc your code. You'll need this if you're using JS/Angular or Dart/Web UI.

I also want to clarify the hiring question... hiring someone who really knows JS, the insides and out and who can write JS without jQuery :), is tough. Dart, on the other hand, is quite familiar to anyone with an OOP background. A decent developer will pick up Dart in a few hours.

Hope that helps! Interested to hear what you come up with.
Seth Ladd
+
2
8
9
8
 
+Alex Wolkov one clarification, Dart doesn't want to change what you know. Dart loves HTTP, JSON, HTML5, CSS, Web Components, and modern browsers. There is one thing Dart wants to help change, though. Dart would like all web developers to up their game: build more feature-rich, 60fps, offline capable, mobile friendly, stunning apps built for modern browsers. How you get there (Dart, Angular, stone and chisel) doesn't matter. We as web developers should be all building towards the same goal: help make the web the premier place to launch apps and experiences that meet and exceed user expectations.
 
+Seth Ladd Thanks for the input. Here's some answers to the issues you mention:
1) The assumption is that the dev will be working on his own, no other developers on the team, and he is comfortable and well versed in both OOP and JS.

2) Irrelevant. WebStorm and Dart Editor are somewhat equal in power, with WebStorm generally being significantly ahead of Eclipse in terms of performance and stability.

3) - 7) and 9) I could go either way on these, no deal breakers. Like I mentioned in the original question, it can all be caught up to with hacks and 3rd party libraries, regardless of which is chosen.

8) This I did not know. This is important information. So, Dart cannot compile into IE8-compatible JS? How about +AngularJS, will that work well on older browsers?

10) Yes

Thanks
 
+Bruno Škvorc it's true that WebStorm is awesome, they even have a Dart plugin! :) However, WebStorm + JS and WebStorm + Dart are slightly different. With Dart, you have a truly statically analyzable language, and thus your tool can give you real refactoring across a project that has, say, 100k lines of code or more. JS is just too dynamic to be able to do that.

I wouldn't underestimate #4. This one is important to me, personally. I want to see apps like Photoshop in the browser.

I almost forgot, one difference is type annotations (which lead to great tooling). I can't imagine building software today without type annotations. So I guess the real question is, Dart + Web UI or TypeScript + Angular ?
 
+Seth Ladd thanx for that awesome answer!
I admin, I haven't dove into dart to comment on a respectable level, but things you mentioned partly prove my point.

When I go to angularJS front page, I see HTML. in an HTML file.
You wrote that dart supports html with cascading, but it seems that I need to "create" divs, instead of referencing them in my code.
That for me was the difference between extJS (which I hated!) and jQuery.

But I must admit, that I'm not a OOP developer at heart, and while Angular introduces MVC in an approchable way for me, Dart seems to assume that the people who use it were trained in a certain way.
 
+Seth Ladd Quite right, I was a bit quick to dismiss #4 as slightly trivial. I must confess that I did get lost in callback hell quite a few times until the advent of promises, and indeed, refactoring Javascript across an enormous project is like chewing glass.

As someone with a basis in the wonderful world of AS3 (which is basically like object oriented Javascript) and a plethora of Php and Javascript slapped on top, I'm leaning towards Dart in this particular discussion, if only for the purpose of experiencing something radically different.

You say there's no support of IE8, though. Could you elaborate a bit more on that? Also, taking into account that the site might, one day, become mobile-optimized - does that change things?
 
+Seth Ladd is +Dart ever going to support IE8 or are you just going to wait for the market share to change? For me, that's something that will prevent me being able to use it for work, but there's still lots to enjoy and experiment with in the main time. :)
 
I personally LOVE Dart as a language and plan on using it for work. That being said I'm not convinced it's ready for business critical production apps quite yet. I do believe Dart is going to be huge and will move to it at 1.0 just like when AngularJS went 1.0.  


I use Angular extensively in production apps today supporting IE7+. I would recommend Angular today and Dart in the not too distant future.
 
I am a user of jQuery, Angular.js and a huge worshipper of Dart. For me Dart is the better language. Its really great and enjoyable. I come from a java background, so it is the language like java should look like (personal opinion). It was much easier to learn Dart than to learn JavaScript. Anyway, for most of my "die hard" applications i still use JS and preferrably Angular.js. Angular lets me easily organise my code. Its there, its working. Dart is pretty stable these days, but you might run into breaking changes from time to time. Also, Angular.js runs on JS which is already in every browser. Dart needs to be compiled, until all browser vendors support it. That said, if you have some room for dealing with a few language / lib changes from time to time, want a great a language and enjoy something new, then go with Dart. If you want to work with JS, because its old, mature and proven go with it. Basically my experience is that JS code is much harder to organize and to maintain than Dart. for that reason I will definitely move on to Dart where it makes sense and finally stay in the Dart world when it is stable. If it is ever supported by major browser (or on mobile os) vendors I am a happy man. Don't forget, Dart has w3c web components where Angular has its great concept. Both is very similar somehow, and I had no problem understanding web components after using Angular.

And: Seth Ladd knows what he is talking about, carefully listen to him. My opinion is passionated and biased.
 
+Alex Wolkov oh, sorry, I thought you were talking about something else :) It's true you can programmatically build the DOM with Dart's dart:html library, as I showed above. However, you can also do this in Dart, if you want to:

<ul template iterate="fruit in fruits">
  <li>I like {{fruit}}</li>
</ul>

That works in Dart, too. :)

Check out the Web UI library from Dart: http://www.dartlang.org/articles/dart-web-components/ It implements Web Components and is inspired by Model-Driven Views to offer DOM-friendly web apps.
 
+Mark Bennett makes a good point, and one I should have covered above... When do you need to launch? If you need to launch in the next three months, you probably want Angular. Dart is racing to a 1.0 for summer, with the rate of changes diminishing as we approach that release.
 
+Mark Bennett re: browser versions. We see one obvious and loud trend: mobile mobile mobile. That means we'd be wasting time worrying about legacy desktop browsers. The world is moving on, and we can't help developers deliver stunning experiences that amaze users if those users are stuck on Windows XP.
 
+Seth Ladd there is no launch date as the project isn't real. I mean, I have some clients I might be able to convince they need one or the other (or one of each, and I win twice, hah!) but I'm mainly just thinking in advance by posing this question. 

Good to know about the release schedule, though. Interesting points all around worth considering. 

One thing I find curious though - if Dart was made as a web language, why does it need a separate "Web UI"? What part of the web does it cover without it, then? Is the Web UI there just to provide easy creation of components and DOM elements, or is something else afoot?

I agree about the browser vendors issue - as long as mobile support is planned, that's pretty awesome in itself.
 
+Bruno Škvorc Dart works with the DOM (see above) but many of us want something better. Much, much better. So Web UI is a library that gives you new capabilities: Web Components, custom elements, encapsulation, dynamic data-drive views, iteration, conditionals, etc. None of that is in the DOM today, so we have to bring it to life for you :)
 
+Seth Ladd will Dart have a presence at IO this year? Code lab or talks?
 
+Rob Becker oh, it's way too early to know what's in Google I/O, but rest assured we're submitting our fair share of proposals.
 
AngularJS I vouch for that!
 
+James Morrin - I agree with every word.
I've also spent several months with GWT a couple of years ago, and have had a very bad experience with it.

I feel that the web is evolving too fast for something that does not integrate natively with regular HTML + Javascript.
Javascript is constantly improving (ECMA 6 anyone?) and Coffeescript is a good (and simple!) enough option for someone who wants better and more clean syntax.

AngularJS helps you organize your web application and incorporate solid design patterns into your front-end code.
Unless you are building a huge application in the front end, or a complex game - I would go with AngularJS for almost every scenario.

I love AngularJS - so it's +1 for AngularJS for me.
 
+Seth Ladd I have been experimenting with Dart. I certainly like the language. However, my major barrier was the edit/compile/reload loop. I was expecting to be able to run Dartium, and play with Dart code through the debugger - just as one can with JS.  I understand that it can't be done - because of Isolates - but I was amazed how much the process slowed down my thinking.

is there anyway to make Dartium more 'lively'? It would be wonderful to work more directly with Dart.
 
+Andy Burnett There's no compile step when using Dartium. Just edit your dart text files and reload, and you'll see the changes. Sadly, you can't just open dev tools to noodle around yet. We really need a REPL, badly, which will give you the experience of testing a few lines of code. In the meanwhile, what I do is open Sublime and Dartium. It's really quick. I hope that helps!
 
Angular is pretty awesome right now.  Dart looks like it'll be more awesome sometime in the future.  If you are going to be working on this project for quite a while [before release], you might want to gamble on Dart.  If you want to ship very soon and/or don't want to risk waiting, I'd stick with angular and the JS libraries you already know.
 
+Seth Ladd Thanks, at least I know that I am not missing an obvious trick.

Out of curiosity, why do you recommend Sublime rather than the Dart editor?  I have only just started playing with Sublime. Does it have particularly good round tripping with Dartium?
 
+Andy Burnett I mentioned Sublime because it sounded like you wanted the lightest weight way to write Dart code. Dart Editor is great, too, it's really up to you. +Timothy Armstrong is adding more functionality to Sublime plugin, so send feature requests his way.
 
One point I don't see mentioned, is that AngularJS is a JavaScript framework, whereas Dart is a language/runtime. In my view, this means they are not mutually exclusive.
You mentioned that AngularJS doesn't play nice with Dart, although you didn't mention what issues there were. I also understand that there is some overlap between what Dart's libraries provide out-of-the-box, and what AngularJS is trying to achieve.
To answer your question: if you would like to work with the latest, cutting-edge in JavaScript application development, you can't go wrong with AngularJS; it is truly advancing web app development. If, on the other hand, you would like to work with a brand-new language, designed for web development, which is not JavaScript, then Dart is definitely the most different and, I would say, ambitious language, unlike TypeScript or even CoffeeScript.
 
Do these two teams (DART/AngularJS) ever meet and/or have discussions about how the stakeholders (us) should go about deciding which Google solution would be best based upon some simple criteria?  Perhaps a simple flowchart to help all of us figure out our happy path.
 
Does dart ships into 1.0 release(probably in summer) with: 1.stable language,tooling and 2.more abstract framework than dart web components (which I think is competitor for typical js mvc frameworks eg. angular, ember..), so I mean full stack framework eg. meteor.js? I mean fw which solving problems like sharing same code between client/server(eg. share domain model, validation..). When not do you plan this full stack fw in next releases?
 
I use Angular currently. Just started looking at WebUI yesterday and it looks really awesome. The Dart package management and tooling is great.

With Angular, there are performance concerns if you have lots of data bindings on the page (2000+) because of the way that Angular does dirty checking.  Does WebUI suffers from the same problem? +Brian Ford 
 
Information on new frameworks is always inherently dated. I did a lot with dart-web-components and Dart. It is not what I would consider stable by a long stretch. Dart itself seems to keep changing and breaking. I understand why. But, it is what it is. If you have to build something today, Dart seems a bit to nascent. Dart might be a safe bet in 3 to six months. So my questions to the Dart team, is when can I expect some stability in language and API. I am willing to forgo dart-web-components, and am quite happy with Dart core. But when will it be stable? If the answer is six months to a year then I am going to use CoffeeScript or TypeScript (most likely). If the answer is three months, then I will use Dart. Risk is ok. But there has to be some ceiling. 
 
Having a RESTful API, I'm really happy about Angular's ngResource module, which just fits. However I think that it shouldn't be that hard to create my own helper class for this based on dart:html HttpRequest.

But then, second thing: while I understand very quickly form the Angular tutorial how to have client side page navigation through partials (i mean Multiple Views, Routing and Layout Template), I didn't see the same in the dart tutorial. In Dart tutorial, it's very clear and good explained how to set up the editor and all of that, which I really appreciate, but the samples do not show the stuff I need in real apps/sites.

So what would convince me to use Dart instead of Angular (as I'm really just now about to start with the client side part of my app)? It's this:
Take the Angular tutorial and show 1:1 how to do that in Dart. Then really, I'm with Dart (as there is no doubt about how much needed a such well designed and structured language for the web is). Or is this not possible/the idea because of the language/ vs framework point of view? Will we just have to wait for frameworks based on the dart lang? Like AngularDart, how awesome would that be!?!
 
+Rick Hightower and +Daniel Bächtold, AngularJS is clearly a bit further along than Dart in terms of how to build a complete app and in terms of stability. On the other hand, Dart is a more ambitious project since it provides so much more.

If you need something that's extremely complete and extremely stable today, Dart just isn't ready yet--use AngularJS. However, in the long term, I think Dart is going to be really interesting.

I'd also say that AngularJS and Dart fundamentally agree, to a large degree, on how modern Web apps should be built, aside from the fact that AngularJS uses JavaScript instead of Dart.

+Daniel Bächtold, unfortunately, I don't think we're ready to commit to a date for Dart 1.0 yet. Perhaps we'll find out more about timelines at Google I/O.
 
I have been using AngularJS for a while now. I really like how it helps reduce and manage complexity. The nature of angular encourages the use modules, smaller js files, and makes it unambiguous where and to integrate js with html. This is really a big win once you get over the very difference design approach it has compared to all other existing js frameworks.

I would really like to use Dart and Angular together. The Dart language comes with a very nice and consistent common library and encourages good design of you client web code. Using both together would really help a web project gain the terseness and structure of Angular and the scalability of Dart. Unfortunately, I cannot figure out a way to do that right now.
 
+Marcus Martin, Dart's Web UI library is heavily inspired by Web Components which themselves were heavily inspired by Angular. If there are particular things that Angular does that you think the Web UI library should also do, that would be good feedback for the team. I know that I'm personally fond of how they do testing with Karma, and I know we're trying to make it possible to use Karma with Dart.
 
+Shannon Behrens To be very clear, I am not stating that Dart's Web UI is missing features. I think it is comparable to Ember, Dojo or any other JS framework in general capabilities. (Yes, I realize Dart != JS, just talking about framework feature sets here).

What I do not like about every Client UI framework I have seen, except Angular, is that the JS (or in this case, Dart) source files are the "source of truth" for all operations in the client ui. I am not expressing this very well, but with Web UI you cannot be very certain about what will actually occur in a client app without examining both the html and the dart source code. Additionally  the DOM  is heavily modified (by design) using css selectors or Dart's own html injection. This is not "bad," nearly every JS framework and library works the same way. I just believe that heavy reliance on css selectors to control or modify html does not scale well with large projects on large teams.

Angular has a very different approach that results in unambiguous descriptions of what the client code will do contained within the html in html. The js code behind is very simple, and does only what you would expect and no more. If you have never used anguarjs on a project, I strongly recommend doing so. You will quickly see how much less code is written to achieve the same effect and how easy and obvious it is to break up you js into modules.
 
+Marcus Martin, thanks for the response, but I'm a little confused. What you have described seems to match what Dart does without the Web UI library. The Web UI library, in contrast, provides HTML templates like Angular does. In fact, it's very much like Angular. Can you help me understand the difference? I'll admit that I've watched talks on Angular, but I've never used it on a project.
 
+Shannon Behrens, I have only used Dart to do the tutorials here: http://www.dartlang.org/docs/tutorials/. I cannot claim expertise of the language. These tutorials taught me the recommended way to modify the DOM in Dart is using css selectors to find a specific element id. This is similar to JQuery.

To learn Angular, I would recommend watching the egghead videos (take about an hour or two for all of them) http://egghead.io/. Angular work from the other side of the problem and causes html to trigger calls into js to modify the DOM if required, or provide data for the view.
 
+Shannon Behrens Thanks for the correction. The documentation confused me whet it sent me to the tutorial. I will check WebUI again.
 
Web development has always been overwhelming to me. There is so much to worry about and angularjs has fixed it in many ways. But Dart takes it a little forward. You just write your code, compile and dart2js and deploy. And you can do a lot more than client development. You can write concurrent programs with dart on the server side. I hope dart matures really fast so l can stop worrying about using other languages and write all my code in dart. But I feel its going to be a while. Till then Dart is good for my web and mobile development and it feels really easy and intuitive unlike other languages.
Regarding hiring. Give a week to a decent C#, Java or maybe to anyone who has some coding experience OOPS style and I can bet that person will be productive instantly with Dart. Its much more convenient than hiring a JS expert.
So far I am loving using Dart more than I did Angularjs.
 
All good comments.

I started using Rails, and now the RubyMine IDE has a Dart plugin: http://www.jetbrains.com/ruby/webhelp/dart-support.html, so that's a good sign, but Dart's not officially mentioned on the main RubyMine page. I don't see Dream Weaver support for Dart yet. Once it goes mainstream the decision Dart vs Angular will be different.

My question is, what are you guys all using for the back end of your stack? I keep reading that Node.js is a better way to go than Rails, but does Node.js have the ease of use to create Models like in Rails? 

I know this is a Dart vs Angular post, so really wondering what your best practices are when using Dart or Angular with your favorite back end?
 
 
Dart is racing to a 1.0 for summer, with the rate of changes diminishing as we approach that release...
Which summer? 
 
Just an update: Angular has begun a port to Dart. Cool!
 
Heh, this topic still lives :)
Indeed, the worlds have merged. +Seth Ladd  can't wait for your talk on Polymer and AngularDart cooperating to be hosted online though, really interested in hearing about that issue.
Add a comment...