Top Banner
SMACKDOWN Photo credit: ljlphotography via Flickr
17

AngularJS vs Backbone.js Smackdown

Dec 05, 2014

Download

Technology

John Moore

A high level comparison of the popular Front-end JavaScript tools AngularJS and Backbone.js. Angular - a framework, and Backbone, a library, are popular and powerful implementations of MVC-like architecture.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: AngularJS vs Backbone.js Smackdown

SMACKDOWN

Photo credit: ljlphotography via Flickr

Page 2: AngularJS vs Backbone.js Smackdown

About Me

John [email protected]

Page 3: AngularJS vs Backbone.js Smackdown

Why Use a 3rd Party Toolset?

• Implement a tested architecture

• Write less code• DRY• Abstract browser differences• Faster time to market• More time to kick ass and

chew bubblegum Photo: Soriinsim via Flickr

Page 4: AngularJS vs Backbone.js Smackdown

What The?

MVCMVPMVVMMV*MV-WTF

Photo: James McCauley via Flickr

Page 5: AngularJS vs Backbone.js Smackdown

Photo by: Alex Chen via Flickr

A Tale of Two Projects

• Dashboard App• Restful Service –

single domain• Small Team, co-

located• Modern Web

Browsers

• Complex SPA• Large Team• Dozens of

Views• Geographical

ly Diverse• IE 6+

Page 6: AngularJS vs Backbone.js Smackdown

• Prescriptive• Done For You• More rigid

Page 7: AngularJS vs Backbone.js Smackdown

• Less Prescriptive• Use What You Want• Toolbox Agnostic• You Wire

Page 8: AngularJS vs Backbone.js Smackdown

Concepts• Templates• Directives• Models• Scope• Expressions• Compiler• Filter• View• Data Binding• Controllers• Dependency Injection• Injector• Modules• Services• Routing• Animation

• Model• Collection• View• Router

Page 9: AngularJS vs Backbone.js Smackdown

Dependencies

NADAZIP

ZILCH

• jQuery or Zepto• Json2.js (for

ancient browsers)

• Underscore or Lo-dash

Page 10: AngularJS vs Backbone.js Smackdown

Models

Page 11: AngularJS vs Backbone.js Smackdown

Views

Page 12: AngularJS vs Backbone.js Smackdown

Controllers

Karen Elliot via Flickr

Page 13: AngularJS vs Backbone.js Smackdown

DOM Philosophy

“AngularJS lets you extend HTML vocabulary for your application. The resulting environment is extraordinarily expressive, readable, and quick to develop.”

"Get your truth out of the DOM"

Page 14: AngularJS vs Backbone.js Smackdown

Ancient Browser (IE < 9) Support

v 1.2 supports IE 8.

v 1.3 dropped IE8 support

Could be shimmed maybe but is a huge pain

IE 6+

I suggest having json2 and modernizr because old IE really sucks

Page 15: AngularJS vs Backbone.js Smackdown

In Common

• Just JavaScript• All Clientside / Front-end• Don’t Prevent You From Doing Stupid Things• Active Communities• Numerous Plugins / Extensions• Used on Large Commercial Projects• O’Reilly Books / Tutorials / YouTubes

Page 16: AngularJS vs Backbone.js Smackdown

My Recommendations / Parting Comments

• Test• Refactor all the time• Read the source-code• Don’t Hack The Platform• Coffeescript & Jade are the devil

Page 17: AngularJS vs Backbone.js Smackdown

Photo: Tom Coates via Flickr

[email protected]