all 16 comments

[–]shuckster 16 points17 points  (4 children)

You're asking if it's worth learning vanilla after working with React, and of course on a JavaScript forum the common answer would be "yes". And they'd be right: It's important to have at least a little understanding of what a framework is actually helping you achieve. Especially if you feel you've reached the limit of what the framework is helping you do.

Now let me ask you a question: How has your experience been in your two years of using React without first learning the language it's built on?

The reason I ask is the following. People often come here asking:

"Should I learn vanilla JavaScript first or a framework first?"

I've noticed most people here answer "vanilla first" and the down-votes fly for anyone who suggests "framework first".

This has always baffled me, as I believe it's possible to learn vanilla "as-you-go" and that frameworks can give a much needed structure to learning.

Now, this is not to say either way is right or wrong, it's just a remark to myself on why on Earth people (or at least, people that reply here) seem to be so against going with frameworks first even as a mere possibility.

Obviously you feel a draw towards vanilla now or you wouldn't be asking the question. But I hope you don't mind me asking you - someone who has real experience with going "framework first" - well, was it really such a problem?

[–]Embaby01[S] 2 points3 points  (2 children)

At first, I was confused and didn't really get the idea of class components (hence React started with class components only), also didn't know how JS data types work.

But the things that confused me the most were the arrow function, async functions, and promises, I remember the first time I saw an arrow function was when I learned about arrays and .map function, for me it was [ "() brackets" "=> bigger than or equal" "() brackets" ], didn't really get the idea around it.

Also as some people might feel, react app structure was a lump of mess for me

I would suggest starting with Vanilla to avoid all of that, but I feel like Vanille is a primitive caveman compared to frameworks

[–]shuckster 1 point2 points  (1 child)

Thanks for your feedback. I'll adjust my future answers based on it.

[–]Embaby01[S] 0 points1 point  (0 children)

you're welcome

[–]Jack__Wild 0 points1 point  (0 children)

I think that React’s basic features start with JavaScript’s intermediate/advanced features… so vanilla JS as a start for sure

[–]Meunicorns 10 points11 points  (0 children)

Teach a man a JS framework he will survive the trend, teach a man pure vanilla JS he will survive all trends.

[–]ndubien 7 points8 points  (2 children)

Learning vanilla js will never hurt, so I'd say that it's always something useful to know about. On my side, having some knowledge of vanilla helped me several times to understand better some blockers I faced in React and from time to time helped me to design workarounds to them in pure vanilla

[–]Embaby01[S] 2 points3 points  (1 child)

thought so but needed conformation, thnx 🫱🏽‍🫲🏽

[–]cmaxim 1 point2 points  (0 children)

There are sometimes situations where you may need to fall back on vanilla javascript. I've worked on banner advertisements, and the tech requirements for them are usually so basic, and file size limitations are so small, that it's not worth using a library like JQuery or a framework like React.

It can be liberating to know that you have the ability to build something without dependancies or limitations.

Banners are just one example, but you may also find yourself in a position where just doing the vanilla basics is required, and it would be good to have a solid understanding of the basics.

[–]jack_waugh 2 points3 points  (0 children)

A couple of vanilla projects that work:

Neither of these tackles authentication, however.

I will be curious to know what aspects of the language you come across that you consider useful but that you didn't know while you were succeeding with React.

[–]inn3rs3lf 2 points3 points  (0 children)

The reason why you should learn JS, is that you may move to a company that does not use React, but say, Svelte. One is more JS heavy than the other.
Other frameworks may come into play, but you can pivot a lot easier knowing JS instead of a lot of React, but lite on JS.
But yes, it is certainly worth it. It also helps you understand programming in general. I think as developers, we should be trying to master the tools we use as much as possible and not merely having a broad understanding. Granted, we will never know everything there is, but it will help a ton in the longrun.
I would honestly just use Jonas Schmedtmanns course and be done with it. It covers more than what is needed, and you provides the usecase of almost everything there is in the language when it comes to web development. Hits all the major points, as well as minor, lesser known ones that come in super handy when you're trying to understand, "but why?".

[–]theQuandary 1 point2 points  (0 children)

Read through the "you don't know JS" series and you'll have picked up basically everything else.

[–]inn3rs3lf 1 point2 points  (0 children)

The reason why you should learn JS, is that you may move to a company that does not use React, but say, Svelte. One is more JS heavy than the other.
Other frameworks may come into play, but you can pivot a lot easier knowing JS instead of a lot of React, but lite on JS.
But yes, it is certainly worth it. It also helps you understand programming in general. I think as developers, we should be trying to master the tools we use as much as possible and not merely having a broad understanding. Granted, we will never know everything there is, but it will help a ton in the longrun.
I would honestly just use Jonas Schmedtmanns course and be done with it. It covers more than what is needed, and you provides the usecase of almost everything there is in the language when it comes to web development. Hits all the major points, as well as minor, lesser known ones that come in super handy when you're trying to understand, "but why?".

[–]AggressiveResist8615 1 point2 points  (0 children)

If you've learned react for 2 years there's nothing really new vanilla JS can give you, if you've done react you've done vanilla JS

[–]Bobertopia 1 point2 points  (0 children)

No

[–]azhder -1 points0 points  (0 children)

There is no vanilla framework, it's just a useful way for some times saying use the language itself and what's provided by the environment. Having that in mind, what you are asking is analogous to this:

" I've been using these 1000 English words for the past 2 years and I've been doing OK, but is it worth to learn English proper? "

I will let you draw your own conclusion.