Live data from Hacker News

Sproutcore vs jQuery +backbone.js

ryth.posterous.com

1–10 of 48 posts

Re: Sproutcore vs jQuery +backbone.js

#2
The question is are you trying to build a desktop class application or not. If not jquery/backbone is the obvious solution.

If a tablview is particularly interesting to you Cappuccino (http://cappuccino.org) has simply the best tableview out there.

This is what it was like several months ago, and it has only gotten better. http://timetableapp.com/TestingEnviro/imdbdemo/

It's fully customizable too, supporting any kind view you want to put in it, and will remain very snappy.

http://githubissues.heroku.com for example shows of some of this flexibility and performance in a real world app.

Re: Sproutcore vs jQuery +backbone.js

#3
Sproutcore is like a full UI widget toolkit -- analogous to extJS or GWT or java swing in the java desktop world. I am sure you could accomplish a lot very fast with Sproutcore.

However, I chose jQuery +backbone.js because I am comfortable with the MVC paradigm and I have a lot of experience with Struts.

For my current project, I am using java Wicket framework for pages crawlable by search engine while using jQuery +backbone.js for pages that require authentication and have a rich user interface.Even though GWT or SprountCore come with a lot of ready made widgets , the JQuery ecosystem is simply unmatched in terms of widgets available -- with the caveat that you would need to spend some time to get to learn them.

What I miss most in Jquery + backbone.js combo is unit tests and test runners integrated into my build system. If anyone knows how to integrate unit testing of backbone.js based mvc code into ant or maven or any other build system, please post here.

Re: Sproutcore vs jQuery +backbone.js

#4
To throw my hat in the ring (full disclosure, I work on Backbone.js):

Unless you're a really fastidious coder, some sort of library to help structure large-scale JavaScript applications is important -- it's far too easy to degenerate into nested piles of jQuery callbacks, all tied to concrete DOM elements. To that end, choosing any of these options can be a positive step, and I have massive respect for Charles and the Strobe team.

If you want to build a desktop-like application, with Apple-esque UI elements, I'd recommend you go with SproutCore: it's got built-in widgets for all that sort of thing.

For almost any other application, I'd recommend giving Backbone.js a try.

Backbone doesn't assume anything about your UI. You can use the templating engine of your choice, and design your interface yourself. It doesn't tie you down (too much) to a particular data store. We use it with Postgres-backed models, but folks have built apps on MongoDB, CouchDB, and LocalStorage as well.

If you're worried about client-side performance, Backbone is much, much lighter -- both in terms of the amount of JS you have to include on the page, as well as how fast you can make your UI. Following SproutCore's suggested KVO patterns is great for most cases, but can bog down performance terribly on pages with many thousands of items. With Backbone it's a bit easier to choose your optimizations: how granular your templates are, and how much of the page you want to re-render at a time.

Claims are nothing without examples, and fortunately both SproutCore and Backbone have a "Todo List" for an example application. Loading both apps, and peeking in the Webkit inspector:

SproutCore Todos: 2.675 MB Uncompressed, onLoad in 1470 milliseconds (loading from localhost). http://cl.ly/45gI

Backbone Todos: 265k Uncompressed (160 of which is jQuery), onLoad in 202 milliseconds (loading from github). http://cl.ly/4626

... I think that, along with the difference in design, speaks enough for itself.

Re: Sproutcore vs jQuery +backbone.js

#5

To throw my hat in the ring (full disclosure, I work on Backbone.js): Unless you're a really fastidious coder, some sort of library to help structure large-scale JavaScript applications is important -- it's far too easy to degenerate into nested piles of jQuery callbacks, all tied to concrete DOM elements. To that end, choosing any of these options can be a positive step, and I have massive respect for Charles and th…

The documentation for Backbone looks good and includes examples. Much (all?) of the SproutCore documentation does not include examples, leaving you to rely on their IRC channel for help. At least for me, quality documentation is very important!

Re: Sproutcore vs jQuery +backbone.js

#6

To throw my hat in the ring (full disclosure, I work on Backbone.js): Unless you're a really fastidious coder, some sort of library to help structure large-scale JavaScript applications is important -- it's far too easy to degenerate into nested piles of jQuery callbacks, all tied to concrete DOM elements. To that end, choosing any of these options can be a positive step, and I have massive respect for Charles and th…

How dependent is backbone on jQuery? I see that the docs mention zepto as an alternative to jQuery for backbone.view, how hard would it be to extend that to other libraries?

jQuery sits pretty much at one end of the libraries spectrum, being mostly a DSL about dom manipulation. So if you want a bit more structure by using e.g. YUI or MooTools, would there be any big issues?

Re: Sproutcore vs jQuery +backbone.js

#7

To throw my hat in the ring (full disclosure, I work on Backbone.js): Unless you're a really fastidious coder, some sort of library to help structure large-scale JavaScript applications is important -- it's far too easy to degenerate into nested piles of jQuery callbacks, all tied to concrete DOM elements. To that end, choosing any of these options can be a positive step, and I have massive respect for Charles and th…

The more I've played with Backbone the more I've appreciated it. It makes it incredibly easy to structure application in a really, really easy to read and maintain way. It's easy to dramatically cut down on duplicate code and eliminate callback spagetti in favour of clean event driven structures.

Having underscore.js in there as well also allows for much more expressive code than javascript usually allows and takes care of nasties like having to always check whether a property belongs to an object or its prototype when iterating over object literals.

Integration with jQuery is seamless and the scoped $ in views cuts down on selector redundancy nicely.

Thanks for the awesome library!

Re: Sproutcore vs jQuery +backbone.js

#8

Sproutcore is like a full UI widget toolkit -- analogous to extJS or GWT or java swing in the java desktop world. I am sure you could accomplish a lot very fast with Sproutcore. However, I chose jQuery +backbone.js because I am comfortable with the MVC paradigm and I have a lot of experience with Struts. For my current project, I am using java Wicket framework for pages crawlable by search engine while using jQuery +…

javascriptmvc has a command-line-able testing:

http://www.javascriptmvc.com/docs.html#&who=FuncUnit

This video explains it in the second half:

http://cdn.javascriptmvc.com/videos/2_0/2_0_demo.htm

Re: Sproutcore vs jQuery +backbone.js

#9
post #2

The question is are you trying to build a desktop class application or not. If not jquery/backbone is the obvious solution. If a tablview is particularly interesting to you Cappuccino ( http://cappuccino.org ) has simply the best tableview out there. This is what it was like several months ago, and it has only gotten better. http://timetableapp.com/TestingEnviro/imdbdemo/ It's fully customizable too, supporting any k…

In terms of tableview, I find slickgrid a powertool.

https://github.com/mleibman/SlickGrid

Re: Sproutcore vs jQuery +backbone.js

#10

To throw my hat in the ring (full disclosure, I work on Backbone.js): Unless you're a really fastidious coder, some sort of library to help structure large-scale JavaScript applications is important -- it's far too easy to degenerate into nested piles of jQuery callbacks, all tied to concrete DOM elements. To that end, choosing any of these options can be a positive step, and I have massive respect for Charles and th…

I would really like to see a comparison between backbone.js and knockout.js

I just switched a page over to backbone- it is a lot more sane now- thanks! The page had a table view (dataTables as mentioned in the article), but I didn't want to learn the dataTables API, I just wanted to access my data. I added the tableSorter plugin and uiTableFilter search plugin and I had all the dataTables featues I needed.

People are interested in plugins for good reason. I think backbone.js would have a much greater draw if there were re-usable widgets (views/apps/collections). They would probably still be more work to invoke than most frameworks, but would be extremely easy to customize.

Post reply on HN