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.
The last couple of years I've spent working in Flex. Before that I've been building web applications in vanilla JavaScript.
Today I'm switching back to JavaScript but now I'm having trouble in choosing the right JS framework/library for a new medium-size project.
Although all the comments on AngularJS have been positive, I found that getting started with it is not an easy task. The problem is of course the documentation. Although there are tutorials which show you how to do the basic stuff, none explain the concepts or show you how one might structure larger projects.
Before discovering AngularJS I had my mind set at Backbone. The positive side is that there are loads of documentation, tutorials, screencasts, books on the subject. In addition the source code is small and can be used as a reference itself (unlike AngularJS).
So now I'm thinking that Backbone might a better choice for someone who's getting stared with using frameworks in JS programming than AngularJS. Later on, when I manage to train my brain to think in JS, AngularJS might be easier to understand + there will be more documentation available.
I'm now in doubt if that's the right path to choose...
First of all, I'm pretty sure that switching to JavaScript was the right choice.
Selecting a JavaScript MVC framework is indeed a difficult choice, especially because they're popping like popcorns everywhere!
This project might be very helpful regarding this decision: http://addyosmani.github.com/todomvc/
Here is my point of view. Backbone is liberal. It does not impose a rigid structure. It is more a set of conventions than actual code. You will certainly be using something more than just the Backbone framework. This can be challenging, but may result in a better tuned result. Backbone is very extensible by nature, which is a great advantage.
AngularJS augments HTML semantics. Just by saying this you can imagine that it is something much more complex than just "pure" Backbone. Perhaps we may find AngularJS a bit more magical (not magical of course, but things happening with less code, "under the hood", I mean).
They have very different approaches to the problem.
I'm not going to state here every advantage and disadvantage of each one. The link I posted should help you on that.
I too was confused like you, but in short, investigate both, make some spike implementations with both, and check the todoMVC project. Choose wichever suits better your requirements and even personality. :)
A much more fairer comparison could be "Backbone and friends" vs "AngularJS". Don't forget Backbone's friends (plugins and modules).
You can do great things with both.
I've been there past few days. I've implemented a simple CRUD over REST api in both frameworks. Here are my thoughs:
Angular is harder, because it's convention over configuration, new concepts like directives and such, you need to think with extending HTML instead of javascript hacking (which can be not that difficult for flex practitioners).
But in the end I prefer it because it does more than backbone out of the box. You don't need to write jquery stuff. The templating is way more readable than using Backbone and underscore templating. There is less code (easier to maintain), and I like the way I can have a component approach for structuring my clientside code.
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 9 years ago.
I've read some interesting articles and comparisons on JavaScript MV* frameworks and I do know outline of architecture of most popular ones (Ember, Backbone, Angular) However as a PHP programmer (and Symfony 2 lover) who wants to learn one of those in detail, I am concerned if Meteor (my first choice) is flexible enough to be considered a full stack framework so I can abandon server side (eg. PHP) entirely on most basic apps. Until today I thought that PHP + Angular give more possibilites (although it's more time consuming to maintain both server and client side), however I'd like your opinion on that. From what I've seen in meteor's screencast, it seems pretty awesome.
As many people have mentioned, server-side JS would replace the function of PHP completely. But Meteor is much more than that; it allows you to replace your imperative code with declarative code. Meteor takes care of synchronizing the data and you just decide how to render it. No more passing around messages through AJAX. As one article put it, Meteor has made MVC obsolete.
In my experience with meteor, I'm developing a project and reading the book. What I've been able to do with Meteor in a short time has completely blown my mind. Combined with some excellent frontend frameworks such as bootstrap, I don't really have to do any CSS work either (if I don't want to), and that means I can develop without worrying about styling or AJAX, essentially freeing up my time to create awesome applications with very little legwork.
Besides, as they say, it only takes a weekend to try Meteor out. It's not complicated at all if you have JS experience. However, as it took me a bit to understand, it's not necessary to think with MVC anymore. It only took me a couple of days to build my first meteor app so I suggest you try it out!
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 9 years ago.
I am thinking to use Javascript Framework for my project. But I am confused, should I use a Framework or use simple Javascript. Moreover, one more point I want to make I am not much experienced in Javascript. What would be your suggestions for one who is still at beginner level in Javascript?
Regarding beginner doubts:
I was at beginner level JavaScript when I started working with AngularJS last year. To learn the basics of it is really easy. What's even better is that it helps you do fairly complicated things with very few lines of code. Most of the code you write will be what AngularJS calls directives, which also turn out to be the most reusable pieces.
Some of the advanced concepts can be difficult to understand and will take some time though, but overall, I would say that progressing through AngularJS has given me a better understanding of JavaScript.
This was my experience at least, and this post does not aim to sell AngularJS. In my opinion, learning a programming language is, most of the time at least, better done by digging into the raw features of it on your own. But with JavaScript -- and all its quirks -- I found it very helpful to have something to guide me -- in this case, AngularJS.
Regarding frameworks for projects:
When you want to have a large application, with a lot of code and interactions, I've found that frameworks help you a lot. There's a boom of JavaScript frameworks right now, all of which are pretty good. If you want to extend HTML and do declarative programming, there's AngularJS. If you want to work at different levels of abstraction, there's Ember.js. If you want to write most of the implementation yourself, then use Backbone.js. If you're doing a lot of GUI stuff, ExtJS. Most of these frameworks will help you write cleaner, modular and more testable code which greatly improves maintainability in the long run.
The downsides could possibly be:
learning curve - but if you are at beginner level, then you shouldn't worry about this.
overkill - for some projects you really don't need to include 500KB of frameworks and libraries
mismatch - and this, I think, might be the most important factor. For example some frameworks are more suited visual stuff, like charts and animations, while others are good for something else.
Conclusion:
determine what you want to achieve,
find the right tool for the job,
the framework/library (or neither if not required) will be of great help then
and, lastly, more like a general rule:
don't be afraid of doing things right just because it seems too unknown to you
Libraries can be very good. They can help you segment your code, they can help you do a lot of things more easily. I have begun to find backbone particularly helpful for AJAXy web aps. With JQuery, $('#element').hide(); is far easier than document.getElementById('element').style.display = "none";, and JQuery .toggle(); is even better than that. In most cases, they deal with cross browser issues for you very easily as well.
From a design/architecture standpoint, the big disadvantage is the overhead. Once you start using libraries and plug-ins for said libraries, who knows how the code quality is.
From a personal development standpoint, the biggest risk is that you will begin to use libraries as a crutch, and never bother to learn why or how these libraries do what they do. I hate when I see a web page with 15,000 (exageration) <script> blocks in the header, and they leverage perhaps 1/10th of the power of all the plugins and frameworks that they are using. It would be far better to write 5-10 lines of code, than to have an extra HTTP request, and load an entire JS module just to use one function that it contains.
My personal recommendation is to use libraries, but always endeavor to understand what they are doing, and to challenge yourself to write at least part of the JavaScript yourself, until you're at a point where you know what's going on inside JS, and why it's going on. Once you get to that point, you will be much better able to evaluate if a library or plug-in is really what you need, or if you should just write something yourself.
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 had asked a question previously regarding the use of Javascript or Ruby on Rails for the development of web apps and got some very good advice from maerics which basically boiled down to Javascript for Frontend/Smaller apps, RoR for service-side/larger apps (Groupon scope).
After a little digging however, I found out about Node.js and Express.js So my decision is basically back at square one.
I'm looking for a language I can use to take an idea to a functional stage (again, the scope is something like Groupon or Twitter). I am an absolute beginner. I know HTML/CSS and a little jquery, but that's about the extent of my knowledge on web technologies.
I've heard about RoR being very easy to learn, or at least pick up, and has a lot of community/support. But Javascript is everywhere, and can be useful for more than just large scale web apps (and I'd be using it anyway if I used RoR), though is far more complex. Seeing as I have no experience in either, I thought I should pick one now and stick to it for the next ~6 months and see how I go.
But can anyone recommend which one to go for?
When you asked about Javascript and RoR in your previous question, you effectively asked about Node.js and RoR.
If you are building a commercial/enterprise level application, stick with RoR. There are way more resources, bigger communities, relatively stable releases, and you can easily find good developers with RoR experience.
Express.js is like Sinatra for Ruby. Neither is as advanced as Rails, preferring to be more 'basic' and providing a minimal feature set rather than try to be an 'everything at once' framework that Rails is.
Right now, Node.js is rapidly changing its API, still has not hit version 1 and hard to find developers for(you often get people claiming they know node and have 1 year exp with it, when they actually mean they have 1 year exp with client side javascript). Besides, for 99% of the web's purposes, RoR will suffice. Most people only use Node for their pet projects, for testing out the next generation of super dynamic interfaces or websocket integration with Socket.io. If you just want to build an application for commercial purposes, use RoR.
As for difficulty, when you start out, Rails will be a bit magical, it does so many things under the hood, you'll have a little bit of difficulty doing something that doesn't already have a tutorial. But look through the source code of some popular gems or even rails itself, and you'll be up to speed in no time. Ruby is an amazingly simple and beautiful language, and you'll find it simpler and probably more fun than javascript.
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!
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.
Which language will allow a beginner to get up to speed quicker?
Basically which language of the two is easier to learn
Python is more regular, and has not needed to keep supporting every old, redundant feature forever, as Javascript has been forced to do (in order to keep supporting existing sites): these are issues that can make Python easier to learn.
However, Javascript's not too bad, especially if you can choose a reasonably rigid, modular, clean framework such as dojo (if you have to learn about every popular JS framework, or even most of them, it will, however, be a nightmare -- as it will if you have to learn the subtle bugs and incompatibilities of various browsers' implementations of JS and the DOM, rather than getting them covered up by such frameworks as dojo, jquery, or closure).
For learning Javascript, I recommend supplementing whatever tutorial you choose with Crockford's Javascript: the good parts -- it's a very thin book (which sounds like a joke, but it's true!-), fast and easy to read, and stops you from wasting your time on language features that are misconceived, too badly designed to use, or counterproductive. Crockford is a real JS guru and is well worth reading and paying attention to.
Depends what you want to do. If you're just interested in learning a programming language, I would recommend Python because:
The interactive prompt is great for learning a language
It's simple and well-designed, whereas JavaScript has a number of design flaws that can be confusing to newbies
There is a particularly high amount of introductory materials for Python.
It allows you to do all kinds of programming (server, client, games, etc.), whereas JS will limit you a bit more.
They're both pretty straightforward to learn. They more differ in terms of their typical project space - Javascript is usually utilized more for the client-side portion of web applications, while Python is often utilized for the server side of web applications and also standalone non-web apps.
What do you want to make?
The two languages are used for two completely different purposes. JavaScript does work in the browser,1 Python does work everywhere else. Pick the language based on which you want; it's useless to learn a language if you can't even use it for your project. If you want to make a website, for example, you'll have to learn both--JavaScript for the client and Python for the server.
Regardless, to answer your question, both languages are great but I'd say Python is easier to start with. JavaScript's basics are fine, but it features a lot of advanced concepts that you shouldn't have to deal with when learning your first language, IMO.
1. Yes, I'm aware that you can use JavaScript on the server-side, but those implementations are not mature and certainly not for a beginner. Python is much more suited for that kind of thing.
PHP is my thing, but I've played with Python and worked with JS. Being only somewhat skilled in both languages, Python feels nice and clean (although a little wierd) with the forced tabbing conventions and lack of semicolons. JS, on the other hand makes me feel like I need a shower. Especially after debugging in IE.
But the only real answer is the question - What do you want to do with it? Want to make websites do cool things in the browser? Go with JS. Something else? Maybe Python is better suited, as #Amber said.
Edit: As for getting up to speed, here's how it works. Your first language takes you a longer time to learn. Your second takes much less time, and after that it's not long at all since you're mostly just learning new syntax for similar things. So the solution for getting up to speed faster is to jump in right now.
I would say JavaScript is easy to learn. I had to learn it to program the Karotz. It only took about 2 months of Youtube tutorials to learn most of it.