I learned vue.js over the weekend
Tags: webdev, beginners, challenge, frontend
Published: 2021-01-26 15:55:16

---
title: I learned vue.js over the weekend
published: true
description: 
tags: webdev, beginners, challenge, frontend
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/fh6weewqxf8886app0sl.png
---

Oftentimes when I talk with recruiters they'll ask about my experience level in a particular technology or more specifically a JS framework. I find this question a bit odd as surely I can easily learn whatever framework in question in a reasonable time frame. That said - show me a JS framework that takes more than a month to learn and I'll show you a framework which doesn't worth learning.
However, if you want to quickly learn a new framework there are a few prerequisites that you should master first -

[HTML](https://www.learn-html.org) (and what does [XML](https://www.sitepoint.com/really-good-introduction-xml/) means), and ideally more than simply using `<div>` everywhere. Imagine having a conversation to someone who only says [groot](https://en.wikipedia.org/wiki/Groot)".
[CSS](https://developer.mozilla.org/en-US/docs/Learn/CSS) (and ideally [SCSS](https://www.toptal.com/sass/theming-scss-tutorial) and I would suggest putting an extra effort on [https://flexboxfroggy.com/](Flexbox) and [Grid](https://cssgridgarden.com/). I guess you can also learn [bootstrap](https://www.freecodecamp.org/news/learn-bootstrap-4-in-30-minute-by-building-a-landing-page-website-guide-for-beginners-f64e03833f33/) but personally it feels like using "common phrases in Spanish" booklet while trying to close a million dollar deal in Latin America.Finally, of course, you should learn.
[Javascript](https://learnjavascript.online/) (and especially [ES6](https://www.javascripttutorial.net/es6/), which is mostly useful "syntactic sugar" that will make your life easier, as long as you know what stands behind it). I'm very fortunate to work with javascript long enough to see its evolution from callbacks to promises and then to await/async and it really helps to understand how it works (and all its crooks) by knowing its history. And hopefully by then you're already an amazing developer and you realise that frameworks aren't magic, rather than pieces of code written by someone just like you.

Vue, just like all the other frameworks, is ultimately a templating system. Imagine having a calendar component that you can simply write in your HTML code `<calendar />` and *poof* - the browser shows a calendar with all the logic involved. How would you write such a component? by writing some HTML code, probably some javascript and maybe some CSS and then wrapping it all together in a way that the browser can use it. Svelte and Vue lets you write all the code (HTML, JS, CSS) for your component in a single file. React uses JSX to allow writing HTML inside the JS-code and uses functional-CSS (the [horror](https://codepen.io/tigt/post/i-tried-functional-css-and-it-kinda-sucked)!) for its css. Angular usually (but not necessarily) has 3 separate files. The syntax might change but they're all using the same paradigm.

I took upon myself the challenge to learn Vue.js over the weekend. The [live](https://odedshr.github.io/shopping-cart-vue/) demo is available online (and its [code](https://github.com/odedshr/shopping-cart-vue) and its [XD designs](https://xd.adobe.com/view/ca6a2d6e-ea86-48f0-a490-bcfea9d3b243-9f39) courtesy of [my wife](https://www.alexisko.com/)). I should give credits to [Coding Addict](http://youtube.com/watch?v=90PgFUPIybY)'s video on building a shopping-cart. I didn't actually watch it but it inspired me to pick this project. I considered using [Contentful](https://www.contentful.com/) as data-source, but decided to save time of creating 50 records. Instead I created a cake-generator. It didn't take long and it allows me to see different datasets. For longer projects, I would recommend having a consistent dataset that you can actually write tests against.Before starting to code, I double-speed a [Vue tutorial course](https://www.youtube.com/watch?v=ZqgiuPt5QZo) on youtube. There are plenty of them. I also watched this tutorial about the "[Composition API](https://www.youtube.com/watch?v=bwItFdPt-6M)", which is a new format to enter data they introduced and made a lot of the sample code available online not really compatible.

If there's anything I would like you to take from here is that technologies and buzzword recruiters use shouldn't intermediate you. A company's tech-stack shouldn't be an issue when picking a workplace as their two year old code is going to look old regardless. Instead I suggest aiming for a workplace that aligns with your beliefs and that you would actually enjoy working in.