We all know JavaScript has a churn problem. Angular is one of the dependable workhorses of the JavaScript world, though it has had a rocky few years. First React came along and took the throne from AngularJS and then, when it looked like Angular 2.0 might be about to help Google’s team make their comeback, a plucky upstart called Vue showed up on the scene.
It’s been five years since Vue was first released and three since it started to go more mainstream, but 2019 was when things really kicked off. The traditional Vue problem has been that it’s a great framework nobody is using, but that seemed to change this year. It’s not so popular that it can challenge React yet, but it’s finally gaining real industry traction.
Angular’s still here though, and still exceptionally popular, with 55k stars and 15k forks on Github. It has one of the world’s largest tech companies behind it, and some of the best engineers working day and night to make it as good as it can be.
React is winning the race by a country mile, but what about #2 and 3? Today we’re going to be comparing Angular and Vue, so you can help make an informed framework decision.
Vue
Vue is light. That’s its major calling card, and it’s the reason I love it: from its tiny file size to its lightning-fast coding style, Vue stays out of your way until the instant you need it, and then it’s just there. The bigger frameworks from major companies are all about power and having a deep toolbox, but Vue has an uncanny ability to put exactly the tool you need right there in your hand. If I’m given a choice of JS framework, it’s my go-to every time. React isn’t bad (and Angular has its upsides: see below) but Vue is a cool breeze on a muggy day.
That lightness is also sometimes its undoing: there’s a lot of argument online as to whether it can really be called a framework at all (I fall on the side of an enthusiastic ‘yes!’) but it natively lacks key features like routing and dependency injection. Vue is building a pretty lively ecosystem that allows for stuff like this, but it’s not there natively and for some gigs where your options are restricted, that really does matter.
Angular
Angular’s module system helps simplify what can be an overwhelming style of code. It’s a pretty dense framework, but the modules help keep things delineated and coherent. The complexity is often cited as one of the big problems, but the modules help you manage that, and if you can manage it then you’ve got an exceptionally muscular framework on your hands. I’m not going to lie and say it’s easier to use than Vue or React, but it’s exceptionally fully-featured and—if you’re willing to work with it—you can get a lot out of it.
Angular is highly opinionated, and that can cause a lot of issues for developers. The docs are also not particularly comprehensive on the actual issues developers run into in production, and this is a big part of the reason it gets such a bad reputation. Angular needs everything to be just so, but is vague about what just so actually means. It takes a very experienced developer to actually work with, and most will skip to React before they’ve got the chance to become experienced.
So Why Use Angular in 2020?
Because refactoring is difficult and expensive, and so much of the internet is written in it. It’s a Google product, and it’s used extensively all over the show, and if you snub it then you’re going to have a harder time finding work. The difficult works to your advantage there: there’s a lot of code written in Angular, but there’s not a lot of developers writing in Angular. Angular has a huge amount of momentum, and the thing about momentum is that it keeps rolling even when there’s very little thrust.
And because it has a massive support ecosystem around it, which means you can always find the solution for your problem, if you know where to look (coughSTACKOVERFLOWcough).
And because dependency injections are a pain to learn but are a hugely powerful tool once you’ve got them locked down.
And because it’s not that bad. Developers love nothing more than to complain, and Angular works fine. It’s not Vue but it’ll do the job if you’re willing to put up with its idiosyncrasies.
Am I going to be saying the same thing in 2030? Probably not. Momentum runs out, new technologies come and go. I wouldn’t guarantee anything survives in the future, not even Vue, not even JavaScript itself. But Angular is here now, and the smart developer deals with that. I wish I could be using Vue all the time, but Angular gigs still outnumber Vue gigs 3:1 where I am, and I follow the money.
The bloated, dependency-injected money.
If you’re a JavaScript developer looking for a coworking space in Kolkata, consider checking out Zioks.