Live data from Hacker News

Choosing the Right JavaScript Framework

airpair.com

51–60 of 91 posts

Re: Choosing the Right JavaScript Framework

#51
post #45

Earlier quoted context omitted.

> There is nothing good in Backbone today frankly.It was one of the first successfull "clientside" framework AngularJS was released in 2009 [1], whereas Backbone was released a year later in 2010 [2]. [1] http://en.wikipedia.org/wiki/AngularJS [2] http://en.wikipedia.org/wiki/Backbone.js

> AngularJS was released in 2009 [1], whereas Backbone was released a year later in 2010 [2]. Sure,that's why i said > It was one of the first successfull "clientside" framework Did you miss the word successfull or what? furthermore old angularjs looked more like Adobe Spry than current AngularJS,while Backbone hardly evolved(which is not good of course).

> while Backbone hardly evolved(which is not good of course)

Backbone is a much simpler library than Angular. There's less of a need for it to evolve, since it's meant to be extended on a per project basis.

Re: Choosing the Right JavaScript Framework

#52
post #10

Another framework i barely hear about and surprised me a bit recently is sencha/ExtJS. They're growing a lot in the enterprise sector, but they managed to keep pretty up-to-date relative to web/open sources projects such as angular.Eg they added two-way data binding in their latest version in a not-to-ugly way. Anyone here got a real try on sencha (the full package, including sencha architect) recently ?

I've been developing on the sencha products for years. Primarily an ExtJS single page app developed by a large team since 2008 that's now well on its way to 200.000 lines of code. I also wrote a 5 kloc app in sencha touch.

The thing about sencha that makes them different is that they abstract away the html and css parts to a large degree, by constructing the dom programmatically behind an abstracted component api (e.g., a panel component has a title bar, several toolbars, and multiple child components laid out using border, anchor, column or any of the other layout systems). The upside is that the ui controls are richer than standard html controls and require fewer lines to do advanced things (like having a field with server-backed autocomplete). The downside is that html+css skills don't translate well, if at all. Instead of thinking in terms of dom updates, html templates and style rules, you think in terms of the component lifecycle, the container layout system and themes. The skillset required is extensive and specific, and the code is so deeply tied to extjs that no part of it can be reused outside of it.

Some people like it, some people don't. You can't fight the framework. You have to adopt sencha's architecture and component system completely, or you will have a painful time. We have had to invest extensively in training because the framework is so different from other js frameworks that new developers have a hard time learning it.

As for the whole she-bang, sencha cmd, sencha architect and so on. I tried those tools several times, but they always lacked maturity. The last time i looked at it is 2 years ago though, so they may have improved. Meanwhile we just use the frameworks.

Update: I realized I didn't actually say whether I would recommend it or not. I would not choose ExtJS again, but I would choose sencha touch again, despite the API's being so similar. I feel like the use-case of writing a mobile cross-platform app fits in well with the sencha architecture and api, better than other js frameworks. By contrast ExtJS isn't bad, but it's no better than the free alternatives like ember or angular for building traditional web apps, so I don't see the point in spending the money on a license if you're starting from scratch.

Re: Choosing the Right JavaScript Framework

#53
I just did a bunch of research on state-of-the-art JS architectures for a new project I'm working on, and neither of my first two choices are on this list. (Granted, they aren't restricted to MVC either.)

Polymer is interesting because it's the first one that's geared around the idea that the browser is an app rendering engine, not a document reader. Being able to declare your own HTML elements and bind them together could very well be the future of web development. Unfortunately, it's still a bit immature to use commercially.

Hence, I chose React. It's idempotent, which is a fancy way of saying the markup it outputs is a strict function of the inputs it's given - no side effects, no externally-mutable state. This means you can live-edit your markup in your favorite editor without having to reload the browser on every save (using a tool called the Webpack Dev Server with the react-hot package). Using Webpack also means your dependencies are explicitly declared with `require` statements. It has all the benefits of Angular's Dependency Injector without all the boilerplate.

Finally, and perhaps most importantly, it has 0 dependency on the DOM. This means you can render your initial request on the server, and pass markup down to the client that's indistinguishable from what you'd traditionally get from Flask/Django/Rails/PHP. There are no assumptions that your client speaks JavaScript, so it's more friendly to non-browser clients like searchbots, which is in turn safer for SEO. It also means your view is already rendered when it reaches the client, which is important in a world where many clients are phones with underpowered JS capabilities. You get both the benefits of a single-page-app (slow client rendering is still faster than slower network requests, and network requests are smaller if you don't have to also send down the template every time) and those of a server-side one (SEO is maintained, and the client can display your page without waiting to execute the JS first).

I should disclaim that I haven't seriously considered Ember since it's been rebranded from SproutCore; however, I have worked on a few Angular apps; and even forgoing the above benefits, React is just easier to work with.

Re: Choosing the Right JavaScript Framework

#54
The comments are already pretty deep, but I still want to mention that the right framework is all dependent on what your needs are and what your company is willing to support. Which is why I get tired of article comparisons like this, and trust me, I wrote an article on choosing AngularJS[1] but I still wouldn't push it on anyone.

Each framework has it's advantages, and it really depends on where you and your company align with those advantages. When I started my journey I realized I needed better testing for AJAX events in jQuery, which lead me to Backbone. But in 2012 Backbone seemed like an outdated solution to an outdated app landscape. Now it seems even more outdated, but learning it certainly helped elevate my JS game to choose between Angular and Ember (though now I'd through React/Flux and/or Meteor into the mix).

From there it's really about what you need, as I've said before. For me, a lightweight, performance-driven solution with a great testing framework was necessary. Angular is lighter weight than Ember, but both have great testing frameworks, so Angular won. If I wanted better documentation, an easier learning curve, or better community support (it happens that Rails people seem to like Ember because Yehuda works on it) I would have chosen Ember, but that wasn't important to me or my company. Again, that was 2012-2013, today I'm still using Angular but entertaining the idea of having React replace Angular directives, which I still don't like writing. Again, it's all about what works for you and your organization, and that really is about introspection, not about what some article can do to act as your oracle.

[1] http://code.tutsplus.com/tutorials/3-reasons-to-choose-angul...

Re: Choosing the Right JavaScript Framework

#56
i appreciate the author's effort but don't feel like i have a better handle on the applicability of each framework to real projects (like many similar articles). basically, this article lists some good and bad features of each framework with some light commentary about a few of those features, which means it doesn't really help you answer the question implied by the title ("which js framework should you choose?").

i think it might be better to use a non-trivial example and show side-by-side implementations for 10 or so important aspects (routing, templating, data binding, etc.), with commentary on what kinds of projects would benefit the most from each frameworks' approach to each aspect. since airpair is about selling programming expertise, this would demonstrate actual expertise that would be attractive to prospective customers (vs. the ability to talk about programming, which is easier).

Re: Choosing the Right JavaScript Framework

#57
"The scope hierarchy in Angular uses Prototypal Inheritance, which is a new concept to grasp for people coming from Object Oriented languages such as Java and C#. Failing to understand scope inheritance causes many cases of frustrated developers ..."

This is javascript in general not just AnjularJS ... it seems that Google has created a framework that does a little too much. Half the time im doing something that has already been done a thousand times , either making a tab content layout, displaying a dialog , performing an ajax request and editing markup ... I dont need fancy scope for these things. And when I do ill write my own state machine. I feel like all the special AnjularJS features are built to handle stuff like google docs. Most of us dont need this, not every one is on the "kill the desktop application long live the web-app" koolaid ... And ill keep my js logic out of my view and markup, thank you very much (did we not learn this is for the lazy not the smart a long time ago)

Re: Choosing the Right JavaScript Framework

#58

I just did a bunch of research on state-of-the-art JS architectures for a new project I'm working on, and neither of my first two choices are on this list. (Granted, they aren't restricted to MVC either.) Polymer is interesting because it's the first one that's geared around the idea that the browser is an app rendering engine, not a document reader. Being able to declare your own HTML elements and bind them together…

Been meaning to look into React, so thanks for the review. Polymer is really not an option until Web Components are more broadly accepted by the browsers and better specified. One of the things I like about Angular JS is that it represents, IMO, a "baby-step" towards Web Components (which Polymer is built atop) through Directives.

Re: Choosing the Right JavaScript Framework

#59

The comments are already pretty deep, but I still want to mention that the right framework is all dependent on what your needs are and what your company is willing to support. Which is why I get tired of article comparisons like this, and trust me, I wrote an article on choosing AngularJS[1] but I still wouldn't push it on anyone. Each framework has it's advantages, and it really depends on where you and your company…

> But in 2012 Backbone seemed like an outdated solution to an outdated app landscape

Eh. Backbone is good for enabling small elements of interactivity on mostly-static web pages (a design which isn't dead yet and useful if you have a lot of people landing on a lot of individual pages from third-party sources search engines or the like, and you want to keep down page load times). Angular and Ember are much more targeted at fancy interactive web apps where you want to stay in one DOM for a longer amount of time while doing a lot of interaction or page manipulation.

So this part:

> the right framework is all dependent on what your needs are

Re: Choosing the Right JavaScript Framework

#60
post #6

What, no React/Flux? How can this be a serious comparison without React?

React + what? Is there a standard router/controller and model that get's used with React? I think they just could have added the line "As an alternative to using underscore templates in Backbone, you can use React instead."

There are a couple React-only routers but a lot of React.js people (including myself) use Backbone for the router/controller.
Post reply on HN