October 9, 2019

Should You “Learn JavaScript Properly” First?

Justin A @juzzo

I'm studying full-stack web dev currently (online, self-paced), and I'm currently in the Javascript section. My goal is to become a MERN developer - just the love of learning something new, and the challenge.

I'm not going to lie - JS is proving hard in parts, but I'll plod along.

I've read a few articles arguing that indepth JS knowledge isn't necessary for most React implementations.

What are your thoughts on this, especially if you're a MERN developer? How far into your JS knowledge did you move into, before learning React? And what SHOULD the extent of your JS be (before learning a framework), in hindsight?

Thanks guys!

  1. 5

    I find the best way of learning is trying to build something concrete.

    Just pick a project and try to build it, and once you don't know how to do something you will search the documentation, Github or Stackoverflow. This will improve gradually your skills and is way more motivating because you are learning with a purpose.

    Yes maybe your code will be shitty at first, but who cares.

    If you are very new to JS just learn the basics: for loops, filter, map, reduce, ...

    Then what I would do is pick a course on React on Udemy to learn the concepts and try to replicate it with the project.

    PS: Try Vue.js => MEVN

  2. 2

    I don't think it's strictly necessary to learn JS in depth first before going into React, but if your broader goal is to become a good web developer then I would strongly recommend it because having that foundation will serve you well. I'd recommend the You Don't Know JS books (https://github.com/getify/You-Dont-Know-JS) and then put what you learn into practice.

  3. 2

    Hi, I’m also in about the same spot right now. I’ve done a couple intro to JavaScript tutorials(~3 hours of video).

    There’s a good free code camp YouTube video that goes through a full MERN setup. I think that was nice to go through to get a full view of what goes on.

    Then I’m planning on watching 2-5 hours of tutorials on each MongoDB, Express, React, and Node. After this I’ll start a project and see how it goes!

    In total about 10-20 hours of tutorials as course work then jumping in and learning along the way. I find it hard to just try to do a project and learn along the way without any studying beforehand.

  4. 2

    Learned React before really learning JS. Definitely would have learned faster had I properly taken the time to learn the fundamentals of JS.
    I would advise to put in just a few hours going into the basics of JS before jumping into React. I think 5 or 10 hours should be enough.

  5. 1

    Thanks everyone, you've given me alot to think about.

    I think that I'll:

    • learn more JS first
    • transition to VueJS
    • then consider React

    Much appreciated.

  6. 1

    You're definitely playing on hard mode. I had pretty deep knowledge of JavaScript before I React was created and I started with a much more beginner-friendly language before getting into JavaScript.

    Is there a reason you need React at this point or could you build some things with plain old JS or jQuery first? I think it's easier to understand frameworks once you've run into the problems the frameworks were created to fix. If you really need a single page app, I'd second @romainsimon's recommendation to learn Vue. It's a lot easier for newbies to pick up than React is.

  7. 1

    React probably requires more javascript knowledge in comparison to other frameworks. This is because React is not a framework but a library, and there is not framework-specific syntax at the component layer, similar to what you would see in Angular or Vue.

    Also, I find that most devs over-engineer their solution while using React.

  8. 1

    I always fine learning by a course is a good start to get to learn the general format and help you get you started but I then never find I progress. I usually always learn from doing, so I have a project that I want to do/need to do in a certain language, I learn from some tutorials to get me started, but then learn it mostly as I go along working on whatever the project is.

    Yes you might write some bad code to begin with, but as you progress and learn more about you'll learn new ways of doing things and can refactor some of the original "bad" and improve based on what you've learnt over time.

  9. 1

    If you get comfortable with ES6+ javascript you should be ready to go build stuff. I don't really know if I can say where the line is. This could potentially be a simple way to test:

    If you can follow through a react tutorial and only get confused by the novel syntax react brings, then you probably know more than enough js. If the pure javascript logic doesn't confuse you too much, you should be good.

    If you are confused by things like for loops, map, filter, 'this' keyword, XMLHttpRequests etc. then you need to keep working on learning those.

  10. 1

    Definitely not. Just build things and learn what you need as you build.

  11. 1

    I myself took a rather tortuous path to learning javascript - I'd say I 'know' it now, but I am not an expert.

    I use a fairly limited, modern subset of it. None of my code contains 'var', 'function', 'this', 'class' or 'protoype'. It's all fat arrow functions, and closures and object literals and destructuring. Works for me and means I can forget all the gotchas about how it does inheritance.

    I say learn it as you go.

  12. 1

    I would say, at most, read a book (not tutorials) about JS, don't try examples in the book, just read it like a novel, don't try hard to understand inheritance/prototypes, just read the book once to "get a feel" for the language. After this, pick a project you want to build and start building (with the book/tutorials/google/stackoverflow close by).

    After the first project you can go and revisit the book but this time works slowly through it.

    PS: I would ditch the M in MERN :) Use PostgreSQL, i guess you would call it PERN. Also, adjust your goal to be a "developer", not a "JS/PHP/PERN/WHATEVER developer"

  13. 1

    I would most definitely learn JS first. You will learn React or any other Framework faster / better when you know what the code is actually doing behind the scenes. For example what is happening when you write JSX (xml) in React? How are you manipulating the DOM in React?

    Fundamentals are crucial, take time and learn JS and you'll thank yourself down the line. Thankfully I'd been working with Javascript in a Full Stack role for over 6 years before I got into React, and compared to a backend dev friend, I picked React up in 1/5 of the time.

    Good luck and if you need any help - drop me a message on twitter @ 93alan