Being a complete newbie to programming more than one year ago it was difficult for me to grasp all the concepts like variables, loops, functions, objects, classes, synchronous and asynchronous calls, new features in ES6 with `this` operator as the most obscure part in one bit.
At that time AngularJS (1.x) was being transformed into new Angular (Angular 2+), React was on the rise and both frameworks started to dominate the market. I somehow decided to start my journey with AngularJS (not knowing that Angular may be better to learn then). Quite overwhelmed, presumably because of my lack of technical background, I almost dropped programming for good. That’s when I hit upon Vue.js and loved it at first sight.
» Will Vue.js become a giant like Angular or React? Read our article and find out!
Even though I work in Angular now, I still use Vue for smaller projects and consider myself a Vue evangelist. Vue.js is a well-documented, simple yet powerful JS framework based mainly on concepts from Angular and React developed by Evan You and his team. If you wonder what’s the power of Vue, I can name such brands as Alibaba, Baidu, Xiaomi and GitLab. Docplanner is rumoured to refactor its app using Vue. Recently I’ve created a simple Airbnb clone for educational purposes and Vue seemed like a good choice, especially with its Vue DevTools that I used very frequently during this project. You can find more open source examples of using Vue in this great post by Mybridge.
That said, let me guide you through many similarities that Angular and Vue share so that you’re able to have your own opinion.
Vue and Angular Code Similarities
The following sections include similar code written both in Vue and Angular. These simple code snippets are specifically designed so that you’re able to understand that Vue may be a suitable, lightweight solution before jumping into an abundance of features that Angular offers straight away.
String Interpolation, conditionals and loops
Reactivity – interacting with user and property binding
Class and style binding
Declaring imports, props and data
Methods (Functions), Lifecycle Hooks
CLI (Command-line interface) Basics
Template-driven approach – structure of files
There is no bad or good journey through these frameworks.
As you can see, both frameworks share many concepts and approach many situations similarly. There are of course differences but the knowledge I got from Vue helped me further understand more difficult concepts such as modules, services, guards and many other which led me to better understand the background behind the frameworks. It is also important to say that Vue is moving towards TypeScript integration which I find very useful, especially after working a couple of months with Angular now.
What Can You Do Now?
I believe there is no bad or good journey through these frameworks, though. Ask yourself a question how you feel about diving in deep water (Angular) or starting soft (Vue.js).
For more information on comparison with other frameworks, you can visit the official comparison by Vue.js or check the ‘React JS, Angular & Vue JS – Quickstart & Comparison’ Udemy course , where Maximilian Schwarzmüller makes a more detailed comparison between the frameworks.
Remember that it’s very useful to know pure JS before going deep with JS frameworks. This will ensure that you’re not one of these people that write code but don’t understand what they write.
Let me know about your experience with JS frameworks. Do you agree that Vue may be a good start before Angular? Do you think that Vue is enough for you to learn and moving to React or Angular is a waste of time? Do you find Vue powerful enough compared to Angular?