How do I become better at JavaScript?

Study and Learn From Other People's Code

First, in all my years of software development (30+ years), the single most important learning tool to me in all the languages I've learned has been to study and learn from other people's code. 

Ideally, you want to be exposed to well written pieces of code that illustrate good design patterns and tools and techniques that you have not yet seen before.  But, you can actually learn from pretty much any code, even poorly written code (where you're more likely to learn things NOT to do).

In the Javascript world, pick up any third party library that seems useful and interesting to you such as jQuery, Angular, Underscore, Backbone, Modernizr, Async, etc...  Write some code using it (the non-minimized version).  Then, step through some of it's major functions in the debugger and see how to code works and is written.  Within seconds, you will likely see design patterns and techniques you aren't normally accustomed to. Understand those.   Ask yourself why they are doing it that way and what advantages is it giving them.

Now, build an extension to that module.  Understand how the extension mechanism works and is architected.

Load a copy of the library into your code editor and just page down through it.  Look for new top level patterns that you aren't accustomed to. When you see one, stop and study it and understand what it's doing and why.

Read and Answer Javascript Questions on Forums

Then, second subscribe to the Javascript tag on StackOverflow and browse through questions and answers with that tag at least once a day.  There's a huge amount of Q&A there.  It's noisy (there's a lot of not very useful stuff), but there are gems there too and there are very smart people providing answers.  And, bad answers will usually get quickly downvoted or removed so there's a useful filter on the information too. 

You should be able to page through the titles and find several very useful answers every day that teach you things you did not know.  If you're really committed to learning, you can even start trying to answer questions.  This will cause you to have to try to solve someone else's problem and solve it in a way that community thinks is good code.  And, then you'll get feedback on how you did.  This is more time consuming, but if you put the effort in, it's very productive.  I find it better than reading books because every question is a real problem that someone else has that you're actually trying to solve and you get some feedback on how you did.


There are a ton of great free places where you can expand your JavaScript skills using coding puzzles:

Bonfires

Codewars
Project Euler
HackerRank 

No comments:

Post a Comment

Genuine websites to earn money.

If you are interested in PTC sites then this article is for you. I have personally tried many of the sites and found that the best thing ...