News for hackers. Stuff that matters.
Re:A Comparison of Angular, Backbone, CanJS and Ember by corresation on Wednesday April 17, 2013 @07:45AM (#5563851)
I do not mean this to sound cynical, but are people actually building full-fledged web apps with these frameworks? Where are they? Any public examples?

The thing is that these tools generally solve the easiest part of problem space, yet paradoxically they make the novel and interesting parts much more difficult. They may pay off if your job is an assembly line banging out trivial CRUD apps, but I just don't see the real value for any reasonable scale project.

I looked at Angular a while back and while it got rid of a few lines of code, it made the necessary edges of a modern web app incredibly ugly (and truly the biggest waste of time is fighting with your framework). That's one of the reasons I like Backbone's minimalism -- it is more a simple toolbag and less an all encompassing solution that relieves you of any reason to make decisions. Backbone also works very well in a non-pure client-side web app, which are much more common.

Seeing these comparisons I am increasingly getting the impression the discussion is dominated by people procrastinating from their projects, argue over the number of lines of "boilerplate" necessary to create an iterator, which is something that will have negligible significance later on.

Re:A Comparison of Angular, Backbone, CanJS and Ember by ekidd on Wednesday April 17, 2013 @08:03AM (#5563926)
I do not mean this to sound cynical, but are people actually building full-fledged web apps with these frameworks? Where are they? Any public examples?

I'm building a large, complicated app for paying customers with Ember.js. Now that I've actually climbed the learning curve, I'm incredibly happy with the choice. The application has some large, CRUD-like components, but it also involves things like custom touch widgets and extensive drag and drop.

However, it should be kept in mind that Ember.js (and more specifically, the unreleased Ember Data library) is not a mature framework. 95% of the features I want to implement practically fall from my fingertips, and it feels glorious. The remaining 5% require diving deep into the internals of Ember Data. I'm tolerably good at that sort of thing, so it's a reasonable choice for me. But people who don't feel up to reading the source should probably avoid using Ember Data and stick with using jQuery to load JSON into regular Ember.Object instances (which works fine).

I haven't seen any big Angular apps first hand, but I know some former Backbone users who are diving in, and they also sound quite enthusiastic about their choice.

Re:A Comparison of Angular, Backbone, CanJS and Ember by ganarajpr on Wednesday April 17, 2013 @08:00AM (#5563914)
Could you define the "novel and interesting parts"? Perhaps examples of what they are ?

If you are fighting with Angular there is probably a reason. You probably did not read this :

http://stackoverflow.com/questions/14994391/how-do-i-think-i...

In my day job, I am working in Knockout now and as a general principle I dont do DOM Manipulation in my ViewModels. I can, and knockout allows me to. But I dont. I think that just this one single and simple rule has made me a better programmer.

Do you remember Mr. Miyagi in Karate Kid? When he was teaching the kid to learn Karate he wasnt teaching him Karate moves was he? He was teaching him "wax on", "wax off". If the kid had thought "I know better" and fought against this rule he would never have learnt karate. He would have gone home, got beaten up by the kids in his block and also have lost that tournament in the first round.

Its the same with Angular and its rules. If you want to win - dont fight it.. persevere till you understand the significance of wax on and wax off and in the end, trust me, you will feel it . You will end up being a better programmer. To start with your wax on, wax off - read that SO answer.

Re:A Comparison of Angular, Backbone, CanJS and Ember by romaniv on Wednesday April 17, 2013 @10:41AM (#5564729)
From the answer: "First know that Single-page apps are apps. They're not webpages."

This is an artificial dichotomy that aims to obscure architectural deficiencies and explain away usability problems.

Re:A Comparison of Angular, Backbone, CanJS and Ember by camus on Wednesday April 17, 2013 @10:55AM (#5564811)
I agree , they are really webpages.
Re:A Comparison of Angular, Backbone, CanJS and Ember by gline on Wednesday April 17, 2013 @09:18AM (#5564264)
I'm not totally sure it will have been the right choice in retrospect but it was effectively this blog post:

http://corner.squareup.com/2012/04/building-analytics.html

that lead me to prototype using ember. I believe Square's analytics platform - not a "full" web app but a pretty substantial one - is still in production deployment based on ember. Of course, they're probably using whatever version of ember was around 18 months ago, and there have been radical changes since...

It feels very likely to me that these javascript frameworks represent a substantial component of the future of this kind of development. People smarter than I am seem to feel that angular is 'better technology' than ember, or at least that in looking like extensible html it has more in common with the eventual future than ember does.

I'm actually surprised, in this spate of MVC framework posts, that Meteor hasn't gotten more of a mention. In some ways it's younger than the others, and it has some idiosyncrasies (it doesn't actually require that the client and the serve both be written in javascript but you'd never know if from the web site). But the meteor team is incredibly smart and the company is well financed - and they're spending a lot of time and energy on one of the most interesting aspects of the problem, something ember and angular have not worked out: how to synchronize models and data between the client and the server. Meteor has a special protocol for handling this, such that when deployed properly if the data changes in a database the model in the client automatically updates to reflect this.

As someone building a complicated analytical engine with computations done in a python / C++ back-end and structure results visualized in javascript, the idea of being able to reuse models in both places is appealing and the idea that I wouldn't have to spend as much time on data synchronization is almost enough to try to make the switch...

Re:A Comparison of Angular, Backbone, CanJS and Ember by laughfactory on Wednesday April 17, 2013 @12:06PM (#5565232)
I too am a little surprised at how little attention Meteor seems to get. I attribute this to the fact that it sells itself as a client + server technology, rather than a potential client-side only tech (being fed by whatever server you want). When you sell yourself as a client+server then you might have a difficult time attracting the attention of all those who have significant investment in a different back-end, be it Node, Rails, or whatever. But yes, I agree, Meteor looks awesome. It's also got a steep learning curve. And much like Ember or even--I would argue, Angular--it's difficult to see the "magic" right off the bat. And given how new Angular and Ember and Meteor are, there is still a dearth of tutorials, videos, and books to help new comers see the value and get started.

So I'm definitely keeping my eye on Meteor.

That said, correct me if I'm wrong, but doesn't Ember have something similar? If the data changes in the database then won't Ember update the client to reflect this? I'm not exactly clear on the distinction between Meteor's "Live HTML" and Ember's approach.

Re:A Comparison of Angular, Backbone, CanJS and Ember by rdtsc on Wednesday April 17, 2013 @01:19PM (#5565691)
I am probably wrong, but it would be interesting if Meteor allowed other back-ends. There would need to be a shim API (like a way to publish and listen for changes, a way to represent records for ex..) but it seems if MongoDB works other NoSQL dbs at least (and SQL too) could work.
Re:A Comparison of Angular, Backbone, CanJS and Ember by marknutter on Wednesday April 17, 2013 @10:41AM (#5564733)
Well, Google used Angular to re-write DoubleClick, so that's a pretty good example of a large scale application using one of these frameworks in the wild.

Ember.js is being used in http://www.discourse.org

Anecdotally, my team and I are using Angular.js for our mobile offerings of http://kona.com and have been loving it.

I'm not sure why it would be any more difficult to build full-fledged web apps with these frameworks than it would be to use vanilla jQuery or Backbone. Our app has become quite complex and we're still loving Angular.js, for instance. And it's not simply about "getting rid of lines of code", it's also about structure and testability.

I can honestly say we haven't had to fight with angular yet but who knows what will happen down the line. For now, we're very happy.

> Seeing these comparisons I am increasingly getting the impression the discussion is dominated by people procrastinating from their projects

Not sure why this barb is necessary..

Re:A Comparison of Angular, Backbone, CanJS and Ember by corresation on Wednesday April 17, 2013 @10:52AM (#5564796)
It wasn't intended as a barb. If anything it was self-reflection, in that I tend to find myself caught up in essentially trivial things when I get caught in procrastination loops. Perhaps I am projecting.
Re:A Comparison of Angular, Backbone, CanJS and Ember by marknutter on Wednesday April 17, 2013 @10:56AM (#5564819)
I read it wrong then. At any rate, fwiw I actually think Ember.js and Angular.js help with procrastination. It's far to easy to get muddled in the details of how to organize a backbone.js or vanilla jQuery application; at least for me. Going with Angular.js let me move forward faster than I would have otherwise.
Re:A Comparison of Angular, Backbone, CanJS and Ember by just2n on Wednesday April 17, 2013 @04:17PM (#5566879)
This is a trade-off that manifests downstream. Highly opinionated there-is-one-right-way frameworks make it easy to get started because you don't have choice, but also get in your way in the long run because you don't have choice, and that also tends to limit what you can do.
Re:A Comparison of Angular, Backbone, CanJS and Ember by adamnemecek on Wednesday April 17, 2013 @06:33PM (#5567765)
At the same time if you don't have much experience with non-opinionated frameworks, you might end up in a state where your code is even less flexible than it would have been with opinionated frameworks.
Re:A Comparison of Angular, Backbone, CanJS and Ember by davecap1 on Wednesday April 17, 2013 @10:07AM (#5564540)
I built http://www.5by.com on AngularJS in about 3 months, and just a few thousand lines of code. The same thing in Backbone would have likely taken a lot more time and a lot more code.

It was my first AngularJS app, and I was learning it on the job, which is why it took that long. Overall, Angular is a joy to work with and its conventions force you to write clean, readable, decoupled code.

Re:A Comparison of Angular, Backbone, CanJS and Ember by romaniv on Wednesday April 17, 2013 @10:27AM (#5564636)
I find it highly annoying that people who promote client-side MVC and one-page apps always claim that it's trivial to make pages linkable and make browser navigation work, yet the wast majority of real-life single-page apps are missing those features.
Re:A Comparison of Angular, Backbone, CanJS and Ember by marknutter on Wednesday April 17, 2013 @10:44AM (#5564750)
That's because it's not generally a requirement for single-page applications. The idea of a single-page app is to make it feel like a desktop application, not to make it highly linkable (which is why it was stupid for Twitter and Gawker to go the single-app route). But yes, it is incredibly trivial to support it using these frameworks.
Re:A Comparison of Angular, Backbone, CanJS and Ember by romaniv on Wednesday April 17, 2013 @11:14AM (#5564924)
That's because it's not generally a requirement

Is that a new way of saying "I just don't care about it"?

The idea of a single-page app is to make it feel like a desktop application, not to make it highly linkable

I've heard that before... from ASP.NET WebForms developers. Incidentally, I've seen quite a few ASP.NET WebForms applications that were literally a single page with changing panels and hidden controls. Needless to say, they were a bloody mess. Thing that normally could be achieved by linking required code changes. Integrations that could be performed via a simple HTTP post were done using complicated web services.

Links are the essence of the web platform. Calling something an "app" doesn't change that.

Re:A Comparison of Angular, Backbone, CanJS and Ember by marknutter on Wednesday April 17, 2013 @11:50AM (#5565113)
> Is that a new way of saying "I just don't care about it"?

It's one way of saying it, I suppose, yes. We don't worry about linking to states in desktop apps so why would we care about linking to states in desktop-like javascript apps?

> Links are the essence of the web platform. Calling something an "app" doesn't change that.

I agree. But when you make a desktop-like app that lives on the web, then linking isn't as important. I take it your issue is with desktop-like apps on the web?

Re:A Comparison of Angular, Backbone, CanJS and Ember by romaniv on Wednesday April 17, 2013 @01:57PM (#5565922)
My overall problem is that a lot of modern web development trends undermine the reasons web became so popular in the first place.

Linking is an easy example. Something that didn't require any "extra" effort now requires "correct" usage of some framework and extra effort. But there are many other things as well.

Re:A Comparison of Angular, Backbone, CanJS and Ember by marknutter on Wednesday April 17, 2013 @02:04PM (#5565982)
Yeah, but seriously, why would you want to link to a particular state in a desktop-style application? Especially if the intent of the app is to be used by a single user working with private data.

Take google docs. During any given session there could be thousands of different states the app is in at any one time, such as certain formatting options being selected, different popover or dropdown menus shown, or the content in the document itself changing. There'd be no point in providing a different URL for each one of those states.

Re:A Comparison of Angular, Backbone, CanJS and Ember by romaniv on Wednesday April 17, 2013 @02:44PM (#5566222)
Yeah, but seriously, why would you want to link to a particular state in a desktop-style application? Especially if the intent of the app is to be used by a single user working with private data.

For example, to save some kind of setup you often use as a bookmark. This is especially valuable in case there are multiple setups you often alternate between.

To make it more concrete, imagine a table with multiple columns you can sort by and a bunch of search filters at the top. Your users from accounting always sort by date. Your users from HR always filter by a particular status and last name. Your CEO wants to be able to see both views.

If the application supports proper URLs, all of this can be done via bookmarks with no extra coding. Moreover, if someone suddenly develops the need for a new weird workflow, they can service themselves simply by bookmarking the URL.

Re:A Comparison of Angular, Backbone, CanJS and Ember by marknutter on Wednesday April 17, 2013 @02:53PM (#5566299)
Yeah, definitely a good use case for URLs. Good thing it's so very easy to support with these newer frameworks.
Re:A Comparison of Angular, Backbone, CanJS and Ember by prodigal_erik on Wednesday April 17, 2013 @07:20PM (#5567974)
My issue is that content entombed in a desktop-like app, which can't be scraped and repurposed from its stable URL, isn't part of the World-Wide Web, and indeed this is the trend that is going to destroy the Web and replace it with a home screen that is nothing more than a list of client/server silos.
Re:A Comparison of Angular, Backbone, CanJS and Ember by manmal on Wednesday April 17, 2013 @10:39AM (#5564716)
If you use Ember correctly, you get a URL for each application state and can use the back button to your liking. The only downside that I can see here is that after going back, the site might take a while until it has fetched all the data (which is not the case for common web apps). Discourse suffers from that.
Re:A Comparison of Angular, Backbone, CanJS and Ember by k3n on Wednesday April 17, 2013 @01:11PM (#5565633)
> The same thing in Backbone would have likely taken a lot more time and a lot more code.

I think that's an unfounded (not to mention unfair) statement, unless you've actually attempted to do so and can provide some objective data points. Otherwise, it's nothing but opinion.

Aside from that, the app does look interesting; I'll have to check it out later.

Re:A Comparison of Angular, Backbone, CanJS and Ember by MaybiusStrip on Wednesday April 17, 2013 @02:40PM (#5566200)
Unless we get a large number of developers to build the same application twice using each framework, all evidence related to this is going to be speculative or anecdotal at best. Having written a lot of both backbone and angular, I can confidently say that I am _much_ more productive with angular, so much that I get incredibly frustrated and resentful when I have to work on a backbone project. I think if you do a little bit of research you'll find a sizeable amount of similar testimony from people who have switched from backbone to a more comprehensive framework.
Re:A Comparison of Angular, Backbone, CanJS and Ember by ulisesrmzroche on Wednesday April 17, 2013 @06:55PM (#5567865)
Once you start supporting persistence and keeping things reliably in sync, things start to get very complicated. You'd still have to write that out in Backbone, when ember or angular provide it out of the box.
Re:A Comparison of Angular, Backbone, CanJS and Ember by hkhanna on Wednesday April 17, 2013 @01:10PM (#5565622)
I like your app. Big fan of the 'timed' time-wasters! Great for short breaks. Thanks for introducing me to it!
Re:A Comparison of Angular, Backbone, CanJS and Ember by matt__ring on Wednesday April 17, 2013 @02:29PM (#5566125)
5by is very nice -- great work
Re:A Comparison of Angular, Backbone, CanJS and Ember by corresation on Wednesday April 17, 2013 @10:53AM (#5564801)
I've spend the last 40 minutes watching various videos brought to me by your app. Fantastic.
Re:A Comparison of Angular, Backbone, CanJS and Ember by evilduck on Wednesday April 17, 2013 @09:35AM (#5564368)
Where are they? Any public examples?

http://builtwith.angularjs.org/

Re:A Comparison of Angular, Backbone, CanJS and Ember by rdtsc on Wednesday April 17, 2013 @10:15AM (#5564579)
Not sure if that helps the case or makes it works:

Cafe Townsend. A page for a concert. Recipe sharing website. HTML5 Canvas Gradient Creator.

Those seems like toy examples one would do that something works, any real/serious public examples?

Re:A Comparison of Angular, Backbone, CanJS and Ember by TallboyOne on Wednesday April 17, 2013 @10:23AM (#5564614)
I always hated that page. It makes angular look like a joke. Ember actually has real sites under it's belt, and I think angular shoots itself in the foot having those novelty 'apps' on there and not a single serious thing.

Although, Analytics is built with angular if I'm not mistaken.

Re:A Comparison of Angular, Backbone, CanJS and Ember by retro212 on Wednesday April 17, 2013 @08:11AM (#5563957)
disclaimer: I work for Bitovi, and I'm a CanJS core comitter

Short answer: yes, people do build real apps with these frameworks.

I stumbled upon JavaScriptMVC (CanJS was extracted from JMVC) 4 years ago when I was building application with a lot of front end code, I think we had around 10k lines of JavaScript in various modules. Trying to build something like that without a framework was a huge pain, and JMVC helped here a lot.

In last few years (after I started working for Bitovi) I worked on pretty big enterprise level applications, and besides being able to build things in cleaner way, a huge plus was ability to allow less experienced developers (from the companies we did consulting for) to implement stuff with familiar structure and without needing to care about memory leaks, zombie events and similar stuff.

IMO CanJS is the best framework currently available, but I'm extremely biased. In the end I don't think it matters which framework people choose because they will get a lot of value just by using any of them.

That said, I would never again use a DOM-centric approach for frontend apps. Live binding is a huge game changer and data centric apps are (in my experience) less buggy and get stuff done with less code.

Re:A Comparison of Angular, Backbone, CanJS and Ember by ghc on Wednesday April 17, 2013 @08:11AM (#5563954)
Yes, there are people building full-fledged web apps...at least with AngularJS and Backbone. Hubspot uses a lot of Backbone in their products, and they're a large company at this point. Google uses AngularJS...the Youtube app for PS3 is written in Angular, for example.

If you find yourself fighting with Angular, it's because you're new to it. Angular is a very rich library...I believe it's definitely possible to do the equivalent of "programming Java in Python" coming from another client library to Angular.

Re:A Comparison of Angular, Backbone, CanJS and Ember by dindresto on Wednesday April 17, 2013 @10:49AM (#5564778)
Not only for the PS3, you can access it online: https://www.youtube.com/tv
Re:A Comparison of Angular, Backbone, CanJS and Ember by ganarajpr on Wednesday April 17, 2013 @11:18AM (#5564940)
OMG dint know that... Thank you sooo freaking much!!!
Re:A Comparison of Angular, Backbone, CanJS and Ember by LaSombra on Wednesday April 17, 2013 @10:55AM (#5564816)
Re:A Comparison of Angular, Backbone, CanJS and Ember by rdtsc on Wednesday April 17, 2013 @10:12AM (#5564564)
Same here. Angular is cool it seems for 'look at pictures my dog took on its collar camera' or 'look how small my todo list code is'. Otherwise it is a world of pain fighting with it.

Basically once you learn Angular you are an Angular programmer from then on. It has its own terminology and way of doing things, I haven't seen the benefit of going that way.

Also looked at its code, founds so much convoluted stuff in that it is a little scary having to run on top of it.

Re:A Comparison of Angular, Backbone, CanJS and Ember by marknutter on Wednesday April 17, 2013 @10:43AM (#5564743)
> Basically once you learn Angular you are an Angular programmer from then on

Kind of like "once you learn Rails you are a Rails programmer from then on"?

I agree that if you're doing nothing but fight with a framework it's probably not a good choice for you. Correct me if I'm wrong but you sound like someone who isn't a big fan of opinionated frameworks in the first place.

Re:A Comparison of Angular, Backbone, CanJS and Ember by rdtsc on Wednesday April 17, 2013 @01:01PM (#5565567)
> Correct me if I'm wrong but you sound like someone who isn't a big fan of opinionated frameworks in the first place.

I think you are right. I have been burnt by enough frameworks both picked by me or others that promise the world ('really easy, just use this framework! here is an example of a thing X that we did for a demo that kind of looks like something you might want to do').

Then as soon as you do something not anticipated or unimplemented yet in the framework you hit a wall and decelerate from 100 to 0 pretty quickly.

I guess a good framework is one that is extensible and straddles the border between a framework and library.

Re:A Comparison of Angular, Backbone, CanJS and Ember by marknutter on Wednesday April 17, 2013 @01:27PM (#5565744)
> I have been burnt by enough frameworks both picked by me or others that promise the world

I've definitely been there, too. I think it's one of the risks in using a framework, but like everything you have to weigh the risks against the rewards.

> I guess a good framework is one that is extensible and straddles the border between a framework and library.

I think Rails did a good job with this. It provides opinionated defaults but allowed people to swap in other libraries as they needed.

Re:A Comparison of Angular, Backbone, CanJS and Ember by tootie on Wednesday April 17, 2013 @10:10AM (#5564550)
I work for a agency that does pretty substantial projects ($1-10M range) and we've done a fair amount of backbone. Angular has gotten a lot of chatter, but isn't really suitable for our kinds of projects.
Re:A Comparison of Angular, Backbone, CanJS and Ember by Joeri on Wednesday April 17, 2013 @03:44PM (#5566635)
I've helped build a 100 K line single page app in ExtJS, and I can see the value ember would have for building that app (have not looked much into angular so cannot comment on that one). What you need in large-scale single page apps are coping mechanisms for the DOM (or as I know it: the root of all evil). Stuff like automatic and on-demand rendering of content, automatic cleanup and event listener removal, nested layouting solutions, strong eventing and routing mechanisms, data binding and automatic data loading, and so on. Any framework that helps you with those things by necessity will invent its own pseudo-DSL, and require you to live in its world.

The way I see it, it's all a matter of what you're optimizing for. If you expect to run at most 2000 lines of code in a single page, then backbone is excellent for that. If you expect to run at least 20.000 lines of code in a single page, then something like ember or ext is needed. You can build those in backbone ofcourse, but you'll probably end up rebuilding much of the infrastructure the bigger frameworks give you out of the box.

Ofcourse, this is separate from the whole debate on whether a pure client-side approach makes sense on that scale. I still think it does, but I think the mixed model is equally valid (different trade-offs in each case). You're right that the mixed model blends poorly with these frameworks.

Re:A Comparison of Angular, Backbone, CanJS and Ember by numo16 on Wednesday April 17, 2013 @09:43AM (#5564411)
Discourse[1] uses Ember for all of its front-end and it seems to work pretty well.

[1]: http://www.discourse.org/

Re:A Comparison of Angular, Backbone, CanJS and Ember by olegp on Wednesday April 17, 2013 @02:00PM (#5565950)
StartHQ (https://starthq.com) is a web app directory and launcher. We are very happy with AngularJS, having used Backbone before. If there's enough interest, I could do a blog post about our experiences.

We are actually adding the ability to list which technologies any given app uses, so you will soon be able to search for all apps in production using any of the frameworks listed above.

Re:A Comparison of Angular, Backbone, CanJS and Ember by harpb on Wednesday April 17, 2013 @01:47PM (#5565872)
Re:A Comparison of Angular, Backbone, CanJS and Ember by chauzer on Wednesday April 17, 2013 @09:57PM (#5568527)
Betterment.com completely rewrote it's front-end app with backbone from Flex - https://engineering.betterment.com/2013/02/a-better-front-en...
Re:A Comparison of Angular, Backbone, CanJS and Ember by ulisesrmzroche on Wednesday April 17, 2013 @06:44PM (#5567816)
There's nothing trivial about keeping data reliably in sync in the browser. It's a hard problem, not something that can be solved by writing a few lines of code in Backbone. It's very misleading to just dismiss it like that.
Re:A Comparison of Angular, Backbone, CanJS and Ember by porker on Wednesday April 17, 2013 @08:37AM (#5564053)
What would you call "the necessary edges of a modern web app"? I agree that these frameworks don't meet all my web app pain points, but thought I was the only one.
Re:A Comparison of Angular, Backbone, CanJS and Ember by varunkho on Wednesday April 17, 2013 @11:04AM (#5564869)
Last time I checked, Udacity was built on angular.
Re:A Comparison of Angular, Backbone, CanJS and Ember by analog on Wednesday April 17, 2013 @09:14AM (#5564238)
There's a list of Backbone examples at http://backbonejs.org/#examples