Should I Learn React or Vue?
The Wrong Question
June 6th, 2018
"Should I learn React or Vue?"
― Brand New Developer
I get this question all the time, and I've heard similar variations for years.Come to think of it, people don't ask about Backbone much anymore...
If you haven't actually shipped anything before, then it mostly doesn't matter what framework you use.When I say "shipped" I mean that at least one person is using a product/tool/service that you’ve built. Only after you start building things will you be at a point where you can evaluate opinions on what the best tool for a particular job is.More importantly, you will need to know both the best tool for the job and for you. If a project has a short deadline and you don't know Erlang -- do not use Erlang no matter how "perfect" it is for the project.
I happen to have strong opinions about React and other frameworks.I've been running js.la since 2012, and co-authored a book on React after all. However, I'm reluctant to share them with beginners because my opinions don't matter much for someone who's just starting out. For example, I care deeply about how maintainable projects are, but it's unlikely that a beginner will create something that needs to be maintained by a team for 5+ years.
It doesn't make sense to have strong opinions on technology choice without a clear idea of what you're trying to achieve."Would you tell me, please, which way I ought to go from here?" "That depends a good deal on where you want to get to," said the Cat. "I don't much care where--" said Alice. "Then it doesn't matter which way you go," said the Cat.
― Lewis Carroll, Alice in Wonderland In other words, if you don't have a clear goal, and you're asking what framework to learn, that's like asking if you should learn to use a lathe, or a CNC machine, or a laser cutter, etc... without knowing what you want to build. They will all do different things for you, and their usefulness will depend on what you want to accomplish.
If you're asking this question because you want to get hired: remember, someone will only hire you if you are able to build useful things. If you don't know what types of things are useful to companies, you'll eventually need to figure that out. However, in the meantime, build something that you think is useful. When learning, you want a tight feedback loop, and there's no tighter loop than if you are your own "client" requesting bug fixes and product features from yourself.
Avoid choosing projects that are too ambitious. It's important to "practice" at a level that is difficult, but not too difficult. If you pick something too difficult, it will take you too long to see progress which will kill your motivation. On the flip-side, if you don't push yourself you can make a lot of progress without mistakes, but you won't learn much.
The sweet spot is to have the right mix of tasks that you know you can do, and some that you're a bit uncertain of. For example, if you're interested in learning React, and you can make simple websites, create a site that is 80-90% simple/similar to what you've done in the past, and only add small bits of React here and there (e.g. add a page with an interactive tool/calculator thing). Do not try to build out a full React web app right out of the gate, and do not try to also learn Redux, Webpack, and whatever else happens to be hot all at the same time.
For a first/early project, the technology used largely doesn't matter, so just pick one and go with it.Obviously in many contexts, language choice does matter. You're going to have a very different time implementing a REST API in C than you will with Node. Your only goal at this point is to make steady progress and finish your project.Many projects can be worked on forever, so I use the word "finish" loosely. Afterwards, start another project, and use what you learned in the first to influence your choices for the second. Then do it again, and again, and again.