Published on

JavaScript Framework which is the best?

This is a question that many developers often ask when starting a new project. In this article, I will help you choose the most suitable JavaScript Framework for your project.
JavaScript Framework which is the best?
Authors
  • Name
    Nguyen Pham

Overview

When starting a new project, many developers often ask the question: "Which is the best JavaScript Framework?" In this article, I will help you choose the most suitable JavaScript Framework for your project.

Instead of being confused by conflicting opinions from the programming community, let's find out which JavaScript Framework is best for your project. The more you understand and have enough detailed information about the project, the more likely you are to make the right decision.

My story

In the past and around the years 2006-2015, jQuery was the most popular JavaScript Framework, although it was very simple compared to what we see today, but at that time it helped many developers build web applications easily and quickly. Not exaggerating, jQuery has made a miracle in the history of web programming. Besides helping me interact with the DOM easily, it was also a real meal, just write a few plugins and you can earn a decent amount of money. Something that few people can do, of course, that is not an easy job.

However, jQuery was "competed" by newer, more modern JavaScript Frameworks such as Angular, React, Vue, Svelte, ... and Node.js, a powerful platform that allows us to build most web applications easily.

Not escaping the whirlwind of the JavaScript Framework boom at that time, I also found myself in a chaotic and suffocating struggle with the vast amount of knowledge surrounding numerous frameworks.

Documentation was scarce while frameworks continued to emerge, improve, and fade away rapidly. Before I could finish learning one, it would be deprecated, and simultaneously, another better option would appear... It was one of the most challenging times for many developers back then.

I struggled with Angular, then jumped to React, Vue... and on days when I felt overwhelmed, I would return to Vanilla JavaScript, TypeScript... only to eventually find myself back with frameworks.

Sometimes I regret the time wasted on these short-lived frameworks, but at other times, I appreciate that these upheavals allowed me to engage more with the strengths and weaknesses of each framework, ultimately giving me more experience for future projects.

Don't compare Frameworks

On the internet, there is no shortage of people comparing Frameworks, some praise while others criticize, making people like me who were once confused even more confused. To be honest, such articles are of no help to readers, perhaps because of hidden advertising purposes or other reasons. But if you are a technology expert, you definitely need a more objective view, you need to present each Framework based on certain criteria, from which to return the decision to the reader.

In fact, many people use popular Frameworks but write bad code, losing to those who write good code with older languages. The most important thing is to write good code, master professional knowledge, not to use any Framework.

Why are there so many JavaScript Frameworks?

Frameworks are created for different purposes, there are Frameworks for building real-time web applications, there are Frameworks for building static web applications, there are Frameworks for building mobile applications, ... Each Framework has its own advantages and disadvantages, and there is no best Framework.

In addition, technology companies also create their own Frameworks to serve their work needs, for example, Facebook created React, Google created Angular, ... This helps them control their technology in the best way, as well as avoid dependence on third-party technologies.

Find the right JavaScript Framework

To choose the right JavaScript Framework for your project, you need to determine the project's goals, job requirements, professional knowledge, ... Don't choose a Framework just because it is popular, but choose a Framework that suits you and your project.

For example, if a WordPress website is 10-20 years old and they want to add a feature, there is nothing better than using jQuery and basic CSS. But if a new company wants to build a simple introduction website that does NOT require real-time, they should not choose NextJS, Angular, Vue, ... but only need Astro or Gatsby, ... is enough.

In addition, choosing a Framework also depends on your current knowledge, for example, if you are new to programming, you should choose an easy-to-learn, easy-to-use, easy-to-understand Framework, once you are proficient, you can switch to more complex Frameworks.

For example, if you are just starting to learn programming, you should choose jQuery, basic CSS, ... to understand how JavaScript's DOM works, CSS properties first, and then switch to more complex Frameworks, however, if you are still not familiar with the MVC model, you should use Vue, Svelte... once you are proficient in TypeScript, you can switch to Angular, React, ... you will find it sweeter.

The longevity of a Framework

With personal experience, I believe that the longevity of a Framework depends on the following factors:

  • Large strong community: A Framework with a large strong community will have many users, many contributors, many supporters, ... This helps the Framework to exist longer.

  • Support from large technology companies: A Framework created by a large technology company will have many resources, many research resources, ... This helps the Framework to exist longer. For example, React was created by Facebook, Angular was created by Google, ...

I don't mean that Frameworks without a large strong community or not supported by large technology companies will not exist in the long run, jQuery is a typical example. jQuery was not created by a large technology company, it was created independently by John Resig, but it still exists and is widely used to this day.

Some comparisons between Frameworks

Below is a comparison between popular Frameworks today, please note that this is not my opinion but from one of the articles on the internet:

FeatureReactAngularVueSveltePreactEmberSolid
Virtual DOMYesNoYesNoYesYesYes
Two-Way Data BindingNoYesYesNoNoYesYes
Component-Based ArchitectureYesYesYesYesYesYes (optional)Yes
SizeSmall (43.9 KB)Large (2.1 MB)Small (80 KB)Small (10.5 KB)Small (3.5 KB)Large (1.3 MB)Small (4.5 KB)
Server-Side RenderingNo (but can be added with Next.js)No (but can be added with Angular Universal)Yes (but not as efficient as Next.js or Nuxt.js)No (but can be added with Sapper or Elder.js)No (but can be added with Preact CLI or SvelteKit)No (but can be added with FastBoot or Glimmer.js)Yes (but not as efficient as Next.js or Nuxt.js)
RoutingReact RouterAngular RouterVue RouterSvelte RoutingPreact RouterEmber RouterSolid Router
Popular Use Cases (e.g.)Facebook, Instagram, Netflix, Airbnb, DropboxGoogle, Microsoft, IBM, CiscoAlibaba Group, Xiaomi, Baidu, Xiaomi YoupinMicrosoft Teams, DiscordEtsy, Deno, Domino’sLinkedIn.com, Yahoo.comDurudex, aoe4world, Web

Code comparison

Svelte:

html
<script>
  let name = "John";
  name = "Jane";
</script>

<h1>Hello {name}</h1>

Angular:

tsx
import { Component } from "@angular/core";
@Component({
  selector: "app-name",
  template: `<h1>Hello {{ name }}</h1>`,
})
export class NameComponent {
  name = "John";

  constructor() {
    this.name = "Jane";
  }
}

Svelte is much simpler than Angular

Looking at the comparison table above, you can see the difference between the Frameworks, but that doesn't mean anything. Why not choose a lightweight Framework like Svelte, Solid, Preact that IBM, Google, Microsoft choose Angular? This clearly shows that such comparisons only show a very small part of the Framework, cannot evaluate which Framework is the best. So don't worry too much about these lists.

Conclusion

Don't choose a Framework just because it is popular or talked about a lot on the internet, but choose a Framework that suits your strength and development time... You will definitely need to take a plane for a long journey but it will not be necessary if the distance is only a few dozen kilometers.

Nguyen Pham

Nguyen Pham

Làm việc tại phòng thí nghiệm MADE, Texas, USA. Là một người đam mê với công nghệ và thích chia sẻ kiến thức với mọi người.

Nguyen Pham — là nhà phát triển và thiết kế giàu kinh nghiệm tập trung vào WordPress, NextJS, Angular. Hãy xem một số dự án chúng tôi đã thực hiện và các sản phẩm nội bộ của chúng tôi.
Liên kết
Made by VueJS and Vercel Cloud· All rights reserved.