Live data from Hacker News

Sproutcore vs jQuery +backbone.js

ryth.posterous.com

11–20 of 48 posts

Re: Sproutcore vs jQuery +backbone.js

#11
post #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?

someone forked a MooTools version, so it is doable.

Zepto is a lighter-weight jQuery compatible library- so you shouldn't feel as bad about having it as a dependency. It might also be possible to have a stripped build of jQuery.

Re: Sproutcore vs jQuery +backbone.js

#12
The main issue I have with sproutcore is that you build the UI in javascript, completely ignoring markup, which feels like a huge regression in layout managment. While this does have performance advantages and Yehuda Katz has promised that they are working on a way for developers to manipulate markup directly thats not how its built to be used currently.

Re: Sproutcore vs jQuery +backbone.js

#13
Backbone.js is easily one of the finest products I have had the pleasure of using. There is a small learning curve but after that, it's butter. The best part, imo, is that more than teaching you to use some foreign dsl, using backbone.js makes you just better as pojs because it teaches modularity, sane callbacks, and a whole mess of other stuff. jashkenas and the other guys behind backbone did a really good job at making a tool that felt like native javascript.

Re: Sproutcore vs jQuery +backbone.js

#14
post #13

Backbone.js is easily one of the finest products I have had the pleasure of using. There is a small learning curve but after that, it's butter. The best part, imo, is that more than teaching you to use some foreign dsl, using backbone.js makes you just better as pojs because it teaches modularity, sane callbacks, and a whole mess of other stuff. jashkenas and the other guys behind backbone did a really good job at ma…

A lot of the credit for the ideas behind backbone should properly go to Robert Kieffer (https://github.com/broofa), an old hand at building JS apps.

Re: Sproutcore vs jQuery +backbone.js

#15

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've done some interesting applications with Backbone.js over the last 2 months or so (for anyone that uses uTorrent, here's one: http://apps.bittorrent.com/ucast/ucast.btapp all in about 800 lines of code, just unzip the btapp file if you'd like to see the source). After trying other things like SproutCore, Cappuccino or Evently, I'll never go back.

I actually ended up being surprised by how backbone changed what I do with javascript. With backbone, you can create views that are really just widgets. For example, if you have a list item, you can create a view specific to that list item. Then, all the events and state for that list item are encapsulated right there. No need to store state in the DOM, you can just fetch it from the model when it happens. This then allows you to bubble events up through the parent views to change the entire page's state. Because of the separation, you really end up having little pieces of javascript that only know about themselves and the whole picture ends up being considerably less fragile and easier to debug.

I'm also a big CouchDB fan. Since backbone models are just documents, the integration with CouchDB is very minimal and you get instant serialization of user state (it really is that easy, to pimp one of my projects: https://github.com/pyronicide/backbone.couchdb.js). There are no server handlers you need to write (hell, don't forget you don't even need to run a web server, Couch'll do that for you!) and you end up with less complexity overall.

Re: Sproutcore vs jQuery +backbone.js

#16
post #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

SlickGrid is excellent.

I didn't like how coupled everything seemed (model, Pagination, etc) [as of 6 months ago, so it may have changed]. I ended up rolling my own remote model, editors, and pagination stuff, but it ended working like a dream. By far the best tableview I've used in a project.

Cappuccino's widgets UI is gorgeous though.

Re: Sproutcore vs jQuery +backbone.js

#18
post #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

JavascriptMVC's unit testing is definitely a big advantage over backbone.

But backbone.js integrates well with my project structure ; I am under the impression ( and I could be very well wrong about this) is that JavascriptMVC requires its own project structure and it has its own code generator of some sort.

It seems that javascriptmvc is geared for huge applications whereas backbone.js is suited for single page apps.

If I am wrong, do please let me know.

Re: Sproutcore vs jQuery +backbone.js

#19
I'm currently using Backbone.js + JQuery in my startup and my decision came down to the following conclusions:

Use Sproutcore or Cappucino if you are trying to emulate a native desktop app and where long load times are acceptable (i.e. the user sacrifices time to load everything to not have to wait much if at all after the initial loading). Also use these two environments when your users are Apple Users.

Use Backbone.js + JQuery in a small startup environment with a lean team where the front-end devs are multitalented (i.e. they can easily move between html/css and javascript)

Use a MVVM framework with bigger teams () and with teams where your front-end guys may be good with html/css and graphic design but have limited or non-existent stills when it comes to programming intermediate to advanced javascript and handling mildly to very complex programming concepts.

MVVM has value and I believe it was invented to solve a common communication/coordination problem in corporate-style environments and especially with "silo"-ed teams and matrix management. However, the way I see it will slow down a good front-end developer. MVC is much more powerful and flexible in the hands of a good dev. MVVM just adds another layer of abstraction so the pure HTML/CSS and graphic design guys don't have to get their hands dirty with real programming.

If you are going the Sproutcore/Cappucino route, you really are commiting yourself to a platform and certain ways of doing things from a user interaction perspective. You will gain a lot in not having to build some basic, common interfaces, but you will lose when you need to invent and create your own custom interfaces.

Summary:

Backbone.js + JQuery = Flexible, powerful, lean - Good for experienced devs

Knockout.js = Less powerful, simple = Overcomes coordination and cooperation issues in teams where "the left hand doesn't know what the right hand is doing"

Cappucino/Sproutcore = Complex apps built fast, inflexibility in interface design patterns. Good for "native-style" apps.

Anyways, those are my opinions. I encourage you to challenge me on anything you don't agree with as my experience with Sproutcore/Cappucino is limited to just research and I only built one small app with Knockout.js.

Re: Sproutcore vs jQuery +backbone.js

#20

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've done some interesting applications with Backbone.js over the last 2 months or so (for anyone that uses uTorrent, here's one: http://apps.bittorrent.com/ucast/ucast.btapp all in about 800 lines of code, just unzip the btapp file if you'd like to see the source). After trying other things like SproutCore, Cappuccino or Evently, I'll never go back. I actually ended up being surprised by how backbone changed what I…

Could you share how you implemented unit testing your backbone controllers' javascript code?
Post reply on HN