Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery vs. New Javascript Frameworks/Libraries (Angular, Ember, React, etc.) [closed]

I'm a ruby on rails developer who only recently started to learn javascript technologies (Angular and React) other than jquery. I read several of those comparison posts to understand why people use different javascript frameworks and libraries, but I still have a difficult time figuring out their significance (quite possibly due to my lack of understanding of how exactly the web works?). One thing I found out while using Angular and React was that I do not need to do deal with ajax separately like I used to with jquery. Also, I do seem to appreciate the syntax and components of React.

Anyways, please help me understand why I should use Angular or React as opposed to just jQuery. Are there things I can do with one but not with another? Are some faster than others? Is it just a matter of style and preference?

like image 260
user3104471 Avatar asked Mar 16 '23 01:03

user3104471


1 Answers

Anyways, please help me understand why I should use Angular or React as opposed to just jQuery.

You don't need any of them. Why learn the latest framework? It will only be obsolete in a few years anyways. Just learn how to leverage modern web technologies such as shadow DOM and HTML includes.

On the other hand if rapid prototyping is what you want use a framework. just know that one day something will break and you will will need to explore the black labyrinth that is the undocumented code of your chosen framework just to find out after days of searching and frustration that is was a simple logic error in your code that would have never happened had you fully understood the function and internal workings of said framework and as no documentation has ever been more than at best 10% complete you will continue this cycle perpetually until you stop using frameworks. This is just the price you pay for more rapid development.

The power of frameworks is also their greatest weakness. We love frameworks like angular because they give us structure and power by abstracting away complexities and allowing us to write less code. By that same token the abstraction layers breed ignorance and laziness as our code base grows and we become more entrenched in our chosen framework.

The best option in my opinion is to learn as much as you can obviously so you will be prepared when a new project lands in your lap that is written in a framework like angular or react but if given a choice the logical decision is the focus on just writing lightweight reusable javascript components without any library, framework, or anything else between you and the DOM.

But you may argue, "won't that just result in you eventually writing your own framework anyway? I don't want to reinvent the wheel!" Even if that is true (and I'm not saying it is, at least YOU will have a full understanding of the capabilities and limits of the framework and its internal mechanics. But most likely if you write intelligent reusable code leveraging modern web technologies you will not need a framework nor will you write one.

If you chose a framework my advice would be to learn as much about it as you can from both the provided documentation and stack overflow. The truth is that to commit a project to using a framework you should know that framework well enough that you could get along without it if you needed to. If and when you are willing to commit I say go for it!

like image 95
dss Avatar answered Mar 23 '23 03:03

dss