4 ms·
I am learning JS myself and here is the order that seems to work for me: 1. DO not start with ANY framework. None. Forget about react, vuejs or whatever the fl
by codegeek 10y ago
I am learning JS myself and here is the order that seems to work for me:
1. DO not start with ANY framework. None. Forget about react, vuejs or whatever the flavor of the month is. Just don't pay attention to it.
1. Start with plain ES5. One good resource:
http://eloquentjavascript.net http://eloquentjavascript.net
2. Once you have a good grasp of ES5, then learn ES6. Again, for ES6, don't worry about Babel or shit like that. Just learn the syntax and new things about ES6 and directly test in Chrome
3. Learn how to compile ES6 into ES5 (Babel etc)
4. Learn Typescript (the daddy of all). Typescript will convert to ES5 or ES6 both. So make sure your concepts of ES5/ES6/ES(n) are clear before you do typescript so that it is not all magic for you.
5. Then, start learning about the bundlers and compilers like webpack and Babel etc. For bundlers, webpack is hot right now. Babel is good for ES6 to ES5 conversion but then again, typescript could take care of that.
6. Finally, time for frameworks. Start with one. React is good. Vuejs is good. They are all good at something. By the time you are at this step and you did all the steps before it, you will know what you are doing.
My 2 cents. This could change depending on which month/year are we talking about :)
- applecrazy 10y agoThanks for your suggestions. One question: why use Babel at all if TypeScript offers type safety and ES6 conversion? Or does Babel have some other "killer feature" that makes it useful in a TypeScript project?
- ohstopitu 10y agoif you use TS, you don't really need Babel at all. However, if you don't (I used TS, it was great, but I had some weird issues so I moved back to JS), Babel is awesome! I just use Babel (with gulp - backend or webpack - frontend) and use just one preset - babel-preset-latest and never worry about ES(x). Not because ES(x) is not important, but because if you keep reading more and more features, you'll get stuck on just those. ES(x) should be more natural... As an example, a function in ES5 would be along the lines of function () { //your_stuff_here } but in ES6 it's more like () => { //your_stuff_here } which is a lot less typing. Also, I'd advice you to use ESlint from the very beginning as it helps you maintain a good coding style from the start.
- PeterisP 10y agoCan you elaborate why you recommend starting with ES5 instead of going directly for ES6, which allows doing some things in a bit more sane way? It's just as likely that OP won't ever write any ES5, if any ES5 code will be needed, then it will be generated/compiled.
- codegeek 10y agoOnly reason is that ES5 is technically the supported version by all major browser as of today. Yes, you can write ES6 and compile to ES5 but I feel like there are lot of goodies in ES5 that you will miss if you do directly with ES6. Just a preference. I probably won't be saying this in next 2-3 years once ES6 is the norm.