Hacker News new | past | comments | ask | show | jobs | submit login
Khan Academy moving to React.js + Backbone (joelburget.com)
55 points by jordwalke on Oct 29, 2013 | hide | past | favorite | 8 comments

Hi, Ben from Khan Academy here -- I'm happy to answer any questions.

Any advice for someone evaluating React/Backbone vs Ember vs Angular?

I think it just depends what you're looking for. React is fairly self-contained and only attempts to provide the view layer, not the model or controller (or however you choose to structure your code). Frankly, that's one of the biggest reasons that we are able to use it at KA: it's easy to adopt into an existing codebase and you can use it alongside whichever libraries you're already using.

Ember and Angular both try to own the entire (frontend) stack, which can work well but usually only if you're building a new app from scratch. In fact, there's been some brief discussion in the React IRC channel about possibly making an easy way to use React views instead of Handlebars inside an Ember app.

Angular has its own share of problems. As I write this, "Things that suck in AngularJS" (https://news.ycombinator.com/item?id=6630156) is on top of the front page of HN. Earlier this summer, I tried learning Angular and gave up because it seemed too hard and I couldn't wrap my head around it properly. Maybe that means I'm too stupid, but it also speaks to the value of creating small, reusable libraries. Angular inundates you with new concepts and confusing vocabulary (e.g., transclusion) and makes it hard to write "directives" (their reusable components), while React's bread and butter is making reusable components and because it's so focused, it does it well.

If you're interested in Angular, you really should go back to the school where you gave the talk. Back when I was a student there (about 6 months ago), I was one of the few to choose it for a project. At that time, Angular didn't offer enough (like Meteor) and wasn't marketable enough (like Backbone) to compete for our time.

But now the school is positively flooded with Angular know-how. In fact, the primary author of the ng-book, Ari, is a guest instructor there, and @gdi2290 (lead FE dev at Keychain, huge Angular guy) is a recent alum who hangs out there all the time basically showing people how much easier their lives could have been if they'd used Angular instead of Backbone or Ember.


Are you writing tests for these views? Any lessons learned?

Not currently. Our frontend testing is extremely sparse at the moment. (We're working on making it better.)

That said, React components are naturally small and reusable and so should lend themselves nicely to unit testing. Even though I don't think it's particularly limiting now, more robust infrastructure to support testing is a future goal for the React team.

Readability link: http://www.readability.com/read?url=http%3A//joelburget.com/...

It's almost impossible to see the text over the background.

Wow, that page is ugly.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact