As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm choosing a javascript framework for my Chrome extension programming (localStorage, lots of ajax calls, filtering, json manipulation). Do you recommend AngularJS or Backbone? I started with JS a few months ago (I have PHP and Java background) and the main problem for me is to have a good and clean structure of my web app.
What I like about AngularJS? The two way binding and the concept itself.
What I like about Backbone? It's really simple for beginner. And there are a lot of resources.
Full disclosure: I work on AngularJS, and obviously have a bit of a bias. ;)
If you're looking for an opinionated application structure, I would definitely stick with AngularJS. Backbone provides many helpful utilities, but there are many choices that you have to make about how you want to connect things. From my experience writing medium/large apps with Backbone.js, I've found that I have to put in more effort to keep things organized compared to AngularJS, which has much clearer separation of concerns.
The best choice is to code little projects in these two libraries.
Why not test and see the code from Todo MVC project from Addy Osmani and after that, make your choice ?
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm working on my project and i used alot of js and jquery in that project and now it's alot messy over here.
I was suggested to move over to some js framework so i started working on backbone.js. I need your guyz help on how i can learn it fast enough as afterwards i've to shift my code in this framework too. I'm beginner in this framework so any suggestion for tutorials or books i can speedily go through and learn it ? Also backbone.js is my only option because i've to use it in further projects as well.
Regards
I think you should start by reading the Backbone.js book by Addy Osmani. If you are familiar with the MVC design pattern then you may start directly from The Internals to get yourself started quickly. Now, after getting a feel of what is possible with Backbone.js, you should try to understand the code of the very simple todo app which has its source code in Github. Try to understand every part of the code - I found it very insightful as I was only beginning javascript and the concepts were new. Some parts of the todo app is explained in the book mentioned above, but some other parts you have to figure out on your own. You will need the help of official documentation. Figure out how to code nested models and views.
Once you have done this, get your hands dirty by starting coding an application. This will give rise to many questions. Now, you have to take help of the documentation, stackoverflow and the #documentcloud, #javascript and #jquery IRC channels when you get stuck.
Most importantly - have fun!
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I want to learn a pattern / process for making and organising proper javascript applications. I am beginning to use OOP to simplify sections of my code, but the code is still messy so I need a process to build bigger things effectively. Should I be thinking about MVC, namespaces or libraries? Not sure if I want to choose a framework yet but any advice/suggestions is greatly appreciated!
jQuery is the best Javascript framework and you can start looking on it following the official website.
Following this blog you can find many tutorials and lessons as well.
Then if you are interested in MVC pattern to use with Javascript I suggest Backbone.
Here is all you need :
http://dochub.io/#javascript/
http://dochub.io/#jquery/
the basic knowledge of JavaScript is good to learn jquery
since the jquery is the library made in JavaScript you can manipulate and understand jquery better
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm looking for tutorial(s) on how to refactor JavaScript application into a JavaScript application using one of the existing JS MVC frameworks. Anyone got any?
Yes, I recommend the Backbone-Boilerplate located at GitHub.
This is beneficial because, not only do you get the Backbone MVC, but also require.js AMD, and underscore.js templates. The authors have been consistently active, and the code is impressive to work with.
Here are the associated tutorials:
Introduction
AMD Module setup
Boilerplate
Overview
Router Explanation
These were the tutorials I used to get it up and running. Also included is Node.js and Grunt build system. They are very much worth the effort if you are not familiar with them. I just saw today that a jQuery project is incorporating the Grunt build system. This is a good setup.
UPDATE: Apologies if you were already aware of the boilerplate. I realize it does not directly relate to refactoring. This looks like a good post on refactoring MVC.
Documentation may be sparse as it would be specific to how your codebase is architected. The key notion would be Data maps to Model, GUI maps to View, Collections contain multiple models, and the Router is used to route events.
Hope that helps.
All the best!
Nash
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I've been very excited with backbone.js recently, but all I can find was minimal tutorials on the web. Have been searching for a backbone.js book, but since it just recently came out, wasn't able to find any. Was hoping you guys know currently in production, perhaps a beta available somewhere?
I do not think Backbone is big enough to require a complete book on it. It is only 4 base JS classes. I would suggest you look for books on MVC and design patterns related to it. This is really the base. Maybe some guides on restful web apps and HTML.
The best book is to read the annoted source here: http://documentcloud.github.com/backbone/docs/backbone.html
As Julien said it might be too small to have its own book, but JavaScript Web Applications by Alex MacCaw might be useful. It has a chapter on Backbone as well as other frameworks and covers a lot of general topics that are likely to be relevant to anyone working with Backbone.
Its available as a beta ebook now.
There is a prerelease eBook called Backbone JS on Rails by some people who are well-known within the Rails community. I haven't purchased access to it yet, but the Table of Contents looks good.
Recently released "Developing Backbone.js Applications: Building Better JavaScript Applications" by Addy Osmani.
Here's a screencast that might be helpful, it comes with a pdf that's a bit like a book.
https://peepcode.com/products/backbone-js
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I want to use a JavaScript framework for a complex web application. I have been looking at Backbone.js, knockout.js and JavaScriptMVC. Being pretty new to client side JavaScript heavy web apps, I'm not sure which one to pick. Each one has a pretty different approach to separate the concerns. Model/View/Controller vs Model/View/ViewModel vs Model/View/Collection.
What do you guys think? What are the deciding factors? Which one would be the easiest to pick up? What has your experience been like?
You can't go wrong either way especially if you are building a complex javascript UI. If you choose not to use either, you will likely wind up with a lot of difficult to debug code. I personally like Backbone but they are both lightweight and allow you freedom in your templating language (I use JQuery templates). I think what made me choose Backbone was the way Knockout mixed its components in with your html:
<span data-bind="text: myItems().count"></span>
You may be able to avoid using constructs like the above with Knockout but that was enough to throw me toward Backbone. I also liked the fact that backbone has dependencies on both underscore and jquery which were already in use in my projects.
To build on HostDude's comment - it's a feature, not a bug :) Part of the concept of knockout is that there's a layer inbetween your Controller/Model and the View. This lets us modularize our HTML into small components that include the data mapping.
So yes the JS bindings are mixed in, but they are not mixed into raw HTML - rather they are added to tiny modularized Jquery templates. By adding those data bindings in explicitly at the jQuery template level, we have total control over what's mapped to what -- without disturbing our underlying application data model at all :) I love Knockout!