

Do we really need javascript frameworks? - Proleps

I started learning javascript and web development a while a go. I decided to learn javascript without any frameworks or libraries so I would properly learn the basics.<p>So far I haven&#x27;t really felt the need to use frameworks or libraries. I&#x27;ve been close to using JQuery but I&#x27;ve able to avoid it until now. But even if I end up using JQuery, it is just a library and not a framework.<p>What do frameworks like Backbone.js, and ember.js have to offer? These frameworks offer functionality at the cost of adding a lot of complexity.
======
cyphax
I have asked myself that question over the last few years and I have come to
the conclusion that I really want these frameworks. In the case of jQuery, for
example: you can program everything in Javascript without using jQuery. On the
other hand, jQuery is not just a lot of code, it's tested code. It's not much
fun having to add browser/engine-specific code to everything you do.
Thankfully, the need for this specifically seems to be slowly fading away now
that all browsers are to a certain extend on the same level.

In the case of such frameworks like Backbone/ember/Angular: these are
implementations of MVC or MVVM or other such patterns, in Javascript. These
make it easy to share data between web services you create, and, in the case
of e.g. Knockout, bind data to controls on your page. You save yourself from
having to write AND test all these things yourself. I have tried, for the
first time, Backbone mere days ago, to see what the added benefit is. It gave
me what's required to send data (in JSON format) to, for example, my
controller, but what's nice about it is, for example, model binding.

It might not be entirely unlike PHP's situation: you can program your projects
in plain PHP, or you can use the Zend Framework or Symphony or whatever you
prefer, which adds a lot of (tested) logic that you otherwise would have to
program yourself.

Do you NEED it? Not using these won't limit you, but you'll probably find
yourself programming these things out yourself in a lot of cases, where many
smart people have done this already.

~~~
Proleps
> _On the other hand, jQuery is not just a lot of code, it 's tested code_

I haven't really looked at it from that point of view, I guess that is a
pretty a pretty big advantage. The basics of writing a widget are pretty
simple most of the time, but testing it on different browsers and edge cases
always takes more time than I think it will.

~~~
cyphax
Before I started using jQuery, I hadn't thought of it that way either. But
after seeing that something that would normally take me days to program (in a
way that it'd work in IE7, for example) only took me hours in jQuery, and
finding that, indeed, it worked in all major browsers right away, I thought of
it that way since! :)

------
meerita
Same question I did myself with HTML/CSS. Do we need those frameworks to do a
website?

The question came to me after I did my 3rd bootstrap like architecture for
some projects I've been working for. You will end doing something like JQuery
in the end, if you want to be organized and want to maintain all in a large
team, you end up doing a framework so everyone does the same.

After doing it 4 times, I realized I can use Boostrap and do the same on 1/4
of the requiered time and, avoid the testing phase for many, many things.

------
chc
If you feel like Backbone adds a lot of complexity, your project is not yet
big enough to need it. For projects that need Backbone, it actually removes
complexity by helping to enforce structure. Organizational tools always seem
pointless until you have a lot of stuff to organize.

------
CyberFonic
No! You don't need them. But ... you'll save yourself lots of time by reusing
tried and tested code instead of writing everything from scratch and having to
debug all the edge cases and behaviours on different browsers.

------
workhere-io
Whether or not you need a framework like AngularJS depends on your website. If
it's just a normal website there's no reason to use a framework. But if it's
more like an app, say a calendar where you can add/edit/delete items without
reloading the page, then AngularJS and similar frameworks come in handy.

------
hkarthik
Aside from functionality and complexity, frameworks can offer consistency and
reliability. The latter two are very important when trying to create large
applications rapidly with larger teams.

