3

From an experienced developer's perspective, is bad practice to create a web application using multiple JS frameworks ?

For example, if you start using AngularJS and if some tasks of the project can be done easier with JQuery, should you go for it, or try to make that part in Angular too ?

Ovy.Istrate
  • 474
  • 3
  • 15
  • 1
    It's certainly not bad practice, indeed [Angular uses jQuery](https://docs.angularjs.org/misc/faq#does-angular-use-the-jquery-library-), or an internal subset if the full library is not present. – James Thorpe Feb 25 '15 at 12:03

1 Answers1

0

In my opinion, a framework should only be used if it's absolutly necessary. E.g if you do lots of DOM work, jQuery is the right one. But, if you need a mvn framework, go for angular/backbone or something like this.

Tio many people today think that for each and every single problem, a framework is the best solution.

Sometimes, it could be the best solution to use 2 frameworks. E.g. jQuery + lodash.

So the answer is... It depends on the type of application you want to develop. My approach would be to allways ask whether the framework is really needed, or if you maybe just need a single function that you better could write on your own.

Christian
  • 6,961
  • 10
  • 54
  • 82
  • I've been working on a SPA project making calls to a ASP .NET Web API 2 application,I've decided to use Angular but yet in the app i had to do lots of DOM manipulation, and for that i wanted to use JQuery (like in other projects) because i think is easier. You can obtain the same DOM manipulation with Angular too, but the code gets more complicated, and i wondered if both frameworks get well when the project becomes bigger. – Ovy.Istrate Feb 25 '15 at 12:30
  • 2
    @Ovy.Istrate I'm not saying that jQuery should never be used but I would suggest that if you are having to rely heavily on jQuery you probably aren't using angular properly and will run into testing problems as a result – charlietfl Feb 25 '15 at 12:33
  • 1
    @Ovy.Istrate Before you start doing lots of DOM manipulation in an Angular app, take a read of [this question's answers](http://stackoverflow.com/questions/14994391/thinking-in-angularjs-if-i-have-a-jquery-background?rq=1) – James Thorpe Feb 25 '15 at 12:43