Hey peeps! Sloan, DEV Moderator and mascot. I'm back with another new question submitted by a DEV community member. 🦥
For those unfamiliar with the series, this is another installment of Sloan's Inbox. You all send in your questions, I ask them on your behalf anonymously, and the community leaves comments to offer advice. Whether it's career development, office politics, industry trends, or improving technical skills, we cover all sorts of topics here. If you want to send in a question or talking point to be shared anonymously via Sloan, that'd be great; just scroll down to the bottom of the post for details on how.
Let's see what we have this week...
Today's question is:
In the JavaScript world, there are so many frameworks! When I read framework comparisons or similar posts, there's often someone in the comments with a line like "Why don't you just drop the framework and focus on Vanilla JS?" As a beginner, this makes me wonder if I should spend more time learning plain old JavaScript and hold off on learning any specific frameworks? I want to establish good practices, but I also want to prepare myself for the job market and do what I need to do to get hired. Any advice?
Share your thoughts and let's help a fellow DEV member out! Remember to keep kind and stay classy. 💚
Want to submit a question for discussion or ask for advice? Visit Sloan's Inbox! You can choose to remain anonymous.
Top comments (5)
As a beginner programmer, I highly recommend starting by learning vanilla JS first, then adding a framework/library or two. Building solid foundations is the key to succeeding as a developer. Hiring managers are almost always looking to hire people who deeply grasp the concepts, because you'll build better code, be better at discussing solutions with other developers, and have a much lower learning curve for new things. It would be much more difficult to learn the foundations of programming if you jump straight into a library or framework.
Also, if you don't have a solid grasp on JavaScript, you won't really understand the benefits / tradeoffs of frameworks and what they're actually doing for you. That's something hiring managers will expect you to know as well.
It might be tempting to jump straight into React, because there's arguably the most demand for it. But most of React is writing JavaScript, so if you don't have a solid grasp on JavaScript going in, you'll have to learn it anyway.
You don't need to avoid React, just make sure you can use core JavaScript concepts like logical operators, functions and classes, arrays, DOM manipulation, event listeners. If you can build a functional frontend with JavaScript, you can probably move on to React and Node/Express to create a full stack application using JavaScript. Full Stack Open is a decent structure for starting with vanilla JS and then moving into React.
As someone who learned JS via the Framework First approach, I recommend to go with whatever is interesting to you.
The "ideal" path might be to learn Vanilla, then expand into frameworks, but imo that's a one way ticket to getting stuck in Tutorial Hell™. Everything I've learned and retained about JS has been from trying to solve a problem I ran into while building something myself, the only trick is to pick small for-fun projects to start with.
For me, this is how I learn things though - I like to get in over my head and slowly work through everything after I realize it's much harder than I was expecting 😅 So this advice isn't for everyone.
Regardless of if you start with a Framework or Vanilla, the code you write in your first app is going to be rough, and a big/complex app that builds on that will be more difficult. If you can work through some of the "oops, I did that in the hardest way possible" with a couple quick builds, it will help a ton when you get to bigger projects.
Some years ago I’d say that you should learn the fundamentals first, but I don’t believe that’s necessarily the case. Pick a framework that you enjoy and that fits the job you’re aiming at, build something ugly and messy and keep asking yourself why it’s messy and ugly and gradually improving your creations.
Eventually you’ll stumble upon a problem that would force you to dig into the basics of JS if not history of web development. Then you’ll know for sure what knowledge you need to get.
My take is: learn that is meaningful to you at the moment. One can’t learn it all and no one should feel obligated to.
Vanilla JS all the way (at least at first)! I think it's very important to understand why we have JS frameworks, and not just "vanilla JS bad, React good". Making a project with vanilla JS will certainly show you why we have frameworks to abstract away a lot of the heavy lifting 😄.
Additionally, on a bit of a tangent, using frameworks before you completely understand the use cases could lead to premature optimization.
Vanilla JS all the way.. in my time ~20+ years ago we had DHTML, there was no frameworks at all, it was perfect because first you need to know grammar before accents and slang in compare to native human languages