How to become a good javascript coder

Viewed 19584

I'm a self learner in javascript and I'm currently following the lessons in the book named "Beginning javascript 3rd edition" by Paul Wilton.

So far I've advanced myself towards chapter 4: Javascript - An object based language, and I did follow and solve the exercises provided inside the book. I tried to write a calculator myself, and by modifying and changing the code, every time I learn something new to enhance it.

How can I become good in javascript coding? Is there any special approach? Is there any concept or things I should learn first? What kind of study/career path should I follow for javascript? Anything I should be aware of?

I really have the courage to continue learning javascript, I just need some guidance.

I don't mind any expert opinion given, or pointing out any mistakes regarding this question, as I know that through my mistakes, I always learn something.

18 Answers
  1. Consider JavaScript as a true programming language
  2. Learn the difference between Object-Oriented and Prototype-Oriented languages
  3. Make sure you understand how JavaScript (language) is related to DOM (API) and never mix things up
  4. Don't jump into "using jQuery to solve all JavaScript problems" as jQuery does not solve any problems of JavaScript but rather those of DOM

A very good way to learn (not restricted to JavaScript) is to have projects where you need to do something with the language (in your case JavaScript) you haven't done or haven't tried.

I have noticed that I improve a lot when I have a project and have to do something I am not really familiar with or I am not that great at. Last project required the use of web services with php, something I had rarely used, but this made be learn and study and just try to get better, which I did.

So my advice is try to have a project where you have to do something with JavaScript that you have no idea how to to.

Conquer Level 1 First...The Princess can wait!

I would just do what is necessary first. Don't bother with the advanced stuff unless it's absolutely necessary. Most of the things you'll use JavaScript for are very top-level and superficial. Get the syntax, loops, types, etc all down first. Don't confuse yourself with the more difficult aspects of it until you've conquered level 1.

Then Move on to Common Solutions to Common Problems

I would even suggest learning something like jQuery before trying to learn how to extend prototypes, etc. Make yourself useful immediately by learning the stuff you'll be using frequently, and tackle the difficult stuff at a later date when you've got the time.

The same way you become a better programmer/writer:

Read a lot, write a little. Repeat ad nauseam.

Also, read this other related answer.

If you are starting on Javascript, I would recommend you going to this website.

However, if you already know bit of javascript, then it all depends on practice. This is the only way i know of that can make you a good programmer. And this apply to just about anything and any programming language.

Try to come up with your ideas and materialize them using Javascript.

How about building your own lightbox?

How about creating your own table filtering/sorting?

And how about all the cool stuff you might have in your mind?

Thanks :)

I would suggest you try to go through following: 1. Book -Javascripts: the good Parts by douglas Crockford. Make sure you understand the points he raises in the book and try to implement them accordingly. 2. Do not just try to javascript functions for website validations; as static functions in javascript is the worst thing a developer can do. 3. Try to implements OOPs concepts in Javascript and see how using functions you can model your objects and their behavior. 4. I would highly recomment small design patterns problems to be solved in javascript, as that would bring out the understanding of functions and invocation patterns in javascript.

Hope it helps. Focus is objects oriented nature of javascript and not just the syntax

It also helps also to install firebug and try out different things in the console.

  1. Start with Javascript : Definitive Guide . Pay special attention to the 1st part core language features
  2. Check crocford blog/site with the reading of this book
  3. Now the time is for Javascript:Good parts
  4. For More in depth knowledge check the ECMAScript3 and 5 refrence
  5. Finally, try to learn some other prototype based language as well like self

For DOM API's check other parts of Javascript : Definitive Guide and sites of respective browsers

I'm surpised with the comments here about learning Javascript. Let's not forget - you don't want to learn it all! While the language is quite great if used correctly, it has a tainted history and many horrid parts. Luckily, you really only have to listen to a single voice:

Douglas Crockford also wrote The Good Parts, which is a nice little Javascript book. He does a bunch of stuff at Yahoo! and has materials on their YUI Theater that explain the problem quite well:

http://developer.yahoo.com/yui/theater/

For beginners w3schools or tizag.com would be more better choice ..

Answer by Sergey is completely agreeable to me .. It is a good approach ..

All the best friend .. :-)

I'd suggest you the definitive guide to the language of your choice!

Please ignore any kind of javascript style kind of programming that may be fashion today.

Just learn the language! Fashions may change, and if you know the language, then you know something that resists, rather then samething that is fashion for some predeterminate time....

For example, read this book! Take the time, and you will reach the next level ;-)

Like with everything else: learn and practice.

How to learn the others already wrote.

I would suggest finding a javascript framework and learning how to use it. Then you can see practical applications to how javascript works in real life. It will give you practical applications, and a much more specific (and larger) set of answers to "how to I..." type problems.

jQuery is a good framework to begin with, YUI and/or Prototype are good if you really want to dig in -- those two are meant for building your own resources, whereas jQuery is more focused on being easily usable.

Modern javascript is heavily about "prototyping" javascript to build in new functionality that's not included in its implemented specification. In other words, it moves beyond the basics of how to code in javascript found in most books and into the realm of "how to make javascript do more than it was intended to do." But the basics are a must if you intend on prototyping the language.

If you want to learn javascript purely for servicing clients and making better websites, then it really depends on how you learn. Personally, I learn more through practical application than just reading and exercises. If you're the same, then I suggest reading through (not working through) your book and meanwhile do a lot of reading up. I suggest "yui vs. prototype vs. jquery" as a starting Google search.

Think up a simple project you'd like to do, and then try and implement as many cool javascript features into that project as you can (ajax form submissions, automatically updating graphics based on form selections, image zoom, and animated fade effects some to mind as the most practically useful).

Again, it really depends on what your goals are -- do you want to become a contributor to a framework like jQuery, write plugins, or just know enough to implement functional javascript on a client website and look good on a resume. If it's the latter -- pick a framework, learn it. jQuery is the most user-friendly, Prototype is the most functional, YUI is as functional as Prototype, well supported, and a great up-and-comer.

Related