Earlier quoted context omitted.
Have you used it? How did it work out?
I'm using it on a project right now. It's my first project with it, but so far so good. The tutorial is quick and straightforward, and it really gives you a flavor for it ( http://docs.angularjs.org/tutorial/ ). AngularJS is a lot like Knockout, without the ko.observables everywhere.
Backbone.js: Hacker's Guide
21–30 of 40 posts
Re: Backbone.js: Hacker's Guide
#22Earlier quoted context omitted.
Have you used it? How did it work out?
I'm using it on a project right now. It's my first project with it, but so far so good. The tutorial is quick and straightforward, and it really gives you a flavor for it ( http://docs.angularjs.org/tutorial/ ). AngularJS is a lot like Knockout, without the ko.observables everywhere.
Theoretically their router should prepend the hash fragment to the URL, but it gets stuck in a redirect loop and hangs the browser. The workarounds I've found so far are to use hash style URLs or not use a default route, neither of which are optimal. (Edit: updating to 1.0.1 fixes the problem as long as your "otherwise" route is a defined route)
Version 1.0 (they are currently on 1.0.1) of the framework broke their website for IE users, which makes me a little nervous about the level of cross-browser testing that the framework uses. Their documentation is sparse in some areas, which is an annoyance more than anything (the source is fine to read, but be forewarned that it's not a small project by any stretch of the imagination).
On the plus side, not having to litter ko.observable everywhere was nice, their concept of services (for working with REST endpoints) is great, and it's been pretty easy to break everything up into maintainable modules.
Re: Backbone.js: Hacker's Guide
#23Could anyone show me what kind of problems Backbone.js solves? Not a description like “it will replace a lot of your jQuery spaghetti boilerplate”, but some actual code: //this is what I had to write in jQuery … … //this is how I'd do it in Backbone.js
Here's my iconoclast answer (with a further caveat that I'm a systems programmer who follows web development in my spare time, not an expert on any of this): Backbone (or Spine, which is just like Backbone but a tiny bit smaller and written in CoffeeScript) is Yet Another MVC Framework. So think of it like Rails, except this time it runs in the client browser. So instead of translating between SQL and Ruby, you're tr…
While you're looking for that, maybe you should consider leaving the explanation of a technology to people who have taken the time to learn something about it.
Re: Backbone.js: Hacker's Guide
#24Could anyone show me what kind of problems Backbone.js solves? Not a description like “it will replace a lot of your jQuery spaghetti boilerplate”, but some actual code: //this is what I had to write in jQuery … … //this is how I'd do it in Backbone.js
I had the same question after trying to use Backbone on a couple different small projects and giving up after seeing it introduce more complexity that I saw it removing. Recently, I discovered Knockout.js, which is a "competitor" to Backbone with what I think is a clearer interface and a much clearer value proposition. I've had a lot of success with Knockout and fully expect that, like Sinatra did to me with Rails, K…
Backbone takes care of syncing your data with the server, provides you with an event system so you can subscribe to changes, gives you a sane convention for how to structure your views and then gets out of your way. It's also easy to extend, so you could write your own data-binding system if you really need it. A simple 1-way data-bind is quite easy to implement.
If you aren't writing a single page app and only need to make a primarily static page more interactive, Knockout is probably the right choice. If you are writing a single page app, you often need to sync your models and collections with the server, or if your UI is very complex, Backbone is probably better.
Re: Backbone.js: Hacker's Guide
#25Earlier quoted context omitted.
I had the same question after trying to use Backbone on a couple different small projects and giving up after seeing it introduce more complexity that I saw it removing. Recently, I discovered Knockout.js, which is a "competitor" to Backbone with what I think is a clearer interface and a much clearer value proposition. I've had a lot of success with Knockout and fully expect that, like Sinatra did to me with Rails, K…
I used Knockout.js on a project before switching over to Backbone. My experience was that while Knockout is great for simple projects, it becomes a lot more complex than Backbone once things get complicated. All those data-binds in the HTML get really annoying and the application becomes difficult to maintain. I like my templates clean. Backbone takes care of syncing your data with the server, provides you with an ev…
Anyways, I think we're saying the same thing. The question: how is Backbone better than jQ; many answers; Ko.js as a middle ground.
Re: Backbone.js: Hacker's Guide
#26Could anyone show me what kind of problems Backbone.js solves? Not a description like “it will replace a lot of your jQuery spaghetti boilerplate”, but some actual code: //this is what I had to write in jQuery … … //this is how I'd do it in Backbone.js
Sure thing. But first, for the "kinds of things" that Backbone helps with, take a quick scroll through the list of examples available here: http://backbonejs.org/#examples Here's a bit of typical (if exaggerated) jQuery to render/update the UI for a list of "accounts": $(".account").each(function(){ var id = $(this).attr('data-id'); var data = window.accountJSON[id]; $(this).find(".name").text(data.name); for (var i…
Re: Backbone.js: Hacker's Guide
#27Could anyone show me what kind of problems Backbone.js solves? Not a description like “it will replace a lot of your jQuery spaghetti boilerplate”, but some actual code: //this is what I had to write in jQuery … … //this is how I'd do it in Backbone.js
jashkenas went over a lot of this in the State of the Backbone at Backboneconf. Regretfully you can't see all of the examples in the video... but you can hear his description here: http://blog.documentcloud.org/blog/2012/06/state-of-the-back...
Re: Backbone.js: Hacker's Guide
#28Earlier quoted context omitted.
I had the same question after trying to use Backbone on a couple different small projects and giving up after seeing it introduce more complexity that I saw it removing. Recently, I discovered Knockout.js, which is a "competitor" to Backbone with what I think is a clearer interface and a much clearer value proposition. I've had a lot of success with Knockout and fully expect that, like Sinatra did to me with Rails, K…
Recently I discovered AngularJS ( http://angularjs.org ) by some of the guys at Google. I spend most of my time on the backend and have never been a fan of JavaScript, but the AngularJS declarative design really caught my eye. It's so clean and so simple. I think it's brilliant. See http://www.youtube.com/watch?v=elvcgVSynRg
Wow, it is nice...
Re: Backbone.js: Hacker's Guide
#29Could anyone show me what kind of problems Backbone.js solves? Not a description like “it will replace a lot of your jQuery spaghetti boilerplate”, but some actual code: //this is what I had to write in jQuery … … //this is how I'd do it in Backbone.js
http://opensoul.org/blog/archives/2012/05/16/the-plight-of-p...
It basically expands on what Jeremy said.
Re: Backbone.js: Hacker's Guide
#30Could anyone show me what kind of problems Backbone.js solves? Not a description like “it will replace a lot of your jQuery spaghetti boilerplate”, but some actual code: //this is what I had to write in jQuery … … //this is how I'd do it in Backbone.js
Here's my iconoclast answer (with a further caveat that I'm a systems programmer who follows web development in my spare time, not an expert on any of this): Backbone (or Spine, which is just like Backbone but a tiny bit smaller and written in CoffeeScript) is Yet Another MVC Framework. So think of it like Rails, except this time it runs in the client browser. So instead of translating between SQL and Ruby, you're tr…
The main issue in my view is that most of the examples out there are just too simplistic. But it's too light to be considered an indoctrination platform like Rails or something like that.