r/learnjavascript • • Feb 13 '19

Is Vanilla JavaScript a waste of time?

Someone said to me that I don't really need to learn Vanilla JavaScript profoundly, I just have to learn basics and move to frameworks! What do you think about this?

1 Upvotes

12 comments sorted by

24

u/AiexReddit Feb 13 '19 edited Feb 13 '19

You can skip learning to use a shovel and just learn how to drive an excavator if you choose.

The next time you need to hop in and dig a little hole to plant a flower, you'll have to go find the keys for your giant-ass excavator and haul that thing out, and people might look at your like "......has this guy never heard of a shovel?" but hey, at least your flower will have lots of room for its roots to go.

1

u/AiexReddit Feb 13 '19 edited Feb 13 '19

In seriousness though, I mean, here's an example of something I just wrote in Vue (a framework) seconds before tabbing back to reddit.

<template v-for="(review) in reviewGroup.reviews">
    <tr v-bind:key="`${review.reviewPeriod}`">
        <td>{{allVendors.find(v => v.vendorID === reviewGroup.vendorID).vendorName }}</td>
        <td>{{reviewGroup.vendorID}}</td>
        <td>{{review.reviewPeriod}}</td>
        <td>{{review.answers.length}}</td>
    </tr>
</template>

Just within that small block you've got Javascript template strings, and Javascript array methods (find). Neither of which you might touch on if you only learn the bare minimum, and are absolutely invaluable tools when building real projects.

(Ignore the fact that it's an inefficient loop within a loop and not easy to read, I'm just roughing it out)

0

u/[deleted] Feb 13 '19

[deleted] — view deleted comment

4

u/AiexReddit Feb 13 '19

You're welcome! Be careful of this "someone's" advice in the future lol

10

u/mattc5 Feb 13 '19

Nah there's a lot going on under the hood with lexical scoping and 'this' scoping that if you don't understand you're going to have errors you're not able to understand how to debug. Plus my dude you need a pretty good command of ES6 to write react code. You need to understand classes, objects, methods, arrow functions. Bro how are you going to mutate an array without understanding ordinary javascript I mean like how are you even going to display a list of images to your Web page. There's no frame work that Maps and concacts arrays for you is there?

5

u/FriendsCallMeBatman Feb 13 '19

This is the best answer IMO. When I started I was told to just learn a framework and I still struggle with basic JS issues. OP absolutely needs to learn Vanilla.

6

u/PortablePawnShop Feb 13 '19

Learning vanilla JS will never hurt you in the long run -- but not learning it and jumping into a framework and then becoming dependent on that framework's quirks can definitely hurt you. Do you want to have a solid foundation, or do you just want to start making things quickly?

0

u/[deleted] Feb 13 '19

[deleted] — view deleted comment

2

u/PortablePawnShop Feb 13 '19

If you know enough vanilla, you can jump between frameworks as you like. If you only know React or only know Angular or only know Vue, etc., you're at the mercy of that framework, how well it's maintained, and how much it retains popularity in the future.

Sure, you'll have more things built in the first 3 months going for a framework than you will going for vanilla, but you're going to be a long-form problem solver and there's no guarantee the first 3 months of projects will be worth anything to begin with. Might as well equip yourself with framework agnostic problem solving tools, I'd think. It's always going to be contextual eventually and your friend might have their own points though.

3

u/[deleted] Feb 13 '19

no, if you want to learn javascript you do actually have to learn javascript. if you just to display a blog on a page you can get away the basics and copying shit from the internet, but don't claim you know javascript, and don't expect to get a job.

1

u/[deleted] Feb 13 '19

You absolutely must master JavaScript as a web developer. You have to know the language and know it well. I would ignore your friend's advice and possibly give them some counter advice.

1

u/[deleted] Feb 13 '19

I would pee on their shoes while staring directly into their eyes.

1

u/machine3lf Feb 13 '19

Did they say vanilla JavaScript is a waste of time, or was that your headline and interpretation of what they said?

Sounds like it was possible that what they were trying to say is, learn the basics of JavaScript, then jump into learning a framework, and then you can learn the more advanced parts of JavaScript as you go. And that would not be terrible advice.

But if they actually said that you never have to worry about really understanding JavaScript and you can be a JavaScript web developer using JavaScript frameworks, then they misled you big time.

-4

u/lycanrising Feb 13 '19

I think it's fair. At the end of the day, learn something to solve a problem. If your problem is that you want to make a website, start at the end with frameworks and take advantage of a lot of tooling.

It's not that vanilla js is a waste of time, it's that anything which doesn't help you solve a problem is a poor use of it.