36

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.

3

18 Answers 18

39
  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
2
27

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.

17

JavaScript is unlike most other languages. While it is Object Oriented, it is weakly typed. This provides much greater flexibility, but at the same time, limits itself.

Keep a few sites in your pocket:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide

http://javascript.crockford.com/

http://www.addedbytes.com/cheat-sheets/javascript-cheat-sheet/

One last thing:

Be aware of Douglas Crockford. Read his books. Read anything you can find with his name on it.

7
  • 52
    "Read anything you can find with his name on it." Your post, mentioning his name, just set me into infinite loop...
    – Sampson
    Dec 30, 2009 at 6:07
  • 1
    LOL, I finally get it. Too late for such deep recursive humor. Dec 30, 2009 at 6:25
  • 1
    Is mentioning the one and only Crockford worth an upvote? No! Sorry, but I have to down-vote this ;) Its true, it is attention-whoring, but it does not help the questioner so much that it'd be worth an up-vote (though most ppl here have a different opinion, but that'd be another topic of crowd-volting-bla-bla)
    – Frunsi
    Dec 30, 2009 at 9:38
  • 3
    And please, please please stay to earth relations: DO NOT EXAGGERATTE! JavaScript IS like most other languages. And the rest of your post becomes persuasively marketing-related emission of whatever.. I DO NOW KNOW. Why does JS limit itself? Why? What? WTF are you writing about?
    – Frunsi
    Dec 30, 2009 at 9:48
  • 1
    If Javascript is unlike most other languages, what must Haskell/Smalltalk/Lisp be? The only thing worth mentioning that is different from the majority common of languages is that it is prototype based not class based.
    – Yacoby
    Dec 30, 2009 at 13:32
9

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.

8
  • 9
    I disagree. Don't start by learning JQuery. Learn the basics. Learn why JQuery does what it does before learning the code. It will help you understand better. Dec 30, 2009 at 6:07
  • 1
    I didn't say "start by learning jQuery." Note that I contrasted learning jQuery to learning how to extend prototype, etc.
    – Sampson
    Dec 30, 2009 at 6:08
  • 2
    I really very admire you all expert.Besides,you guys are very kind.Since i'm small,my mum always taught me,"Teach,give and help,And you'll gain more."So when i getting good in coding.I will always visit this forum to find any question posted by some beginner regarding their difficulties,and i'll help them to solve it,just like you guys^^.anyway thanks again for the guidance and teaching. Dec 30, 2009 at 6:14
  • 4
    You're well on your way, Caramel1991. Keep up the great work! We're glad to have you here.
    – Sampson
    Dec 30, 2009 at 6:15
  • 1
    i started by learning jquery and it was the best thing i ever did. i picked up actual javascript pretty much by osmosis once i had the basics of jquery down. now i handle somewhat complex front end functionality for the UIs at my company using a mixture (ok, jquery IS javascript, but you know what i mean) of jquery and javascript. jquery is brain-dead-stupid easy to learn and will get you on the right track. don't listen to the purists.
    – Jason
    Dec 30, 2009 at 9:19
5

The same way you become a better programmer/writer:

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

Also, read this other related answer.

2
  • Thanks to every expert in here for guidance,anyway is functional approaches means those basic function(alert(),parseInt()) I've learn so far??Sorry sometime i'm quite confuse with javascript,especially function and method.Besides,sometime I'm not really know what's the usage of javascript,so sometime I'll think of something I wanna program,but I'm not sure whether it can be achieve by javascript,but so far I do create a calculator,and keep modifying it. Dec 30, 2009 at 7:05
  • Actually I would say the reverse. Read a little, write a lot.
    – Cloud
    Jan 15, 2019 at 15:45
3

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 :)

3
  1. Program a lot
  2. Read JavaScript: The Good Parts
  3. Use JsLint!
  4. Go to 1
1
  • Great way to answer.
    – 5eeker
    Aug 25, 2015 at 3:25
2

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

2

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

1
  • Not really an answer....
    – Cloud
    Jan 15, 2019 at 15:45
2
  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

1
  • I would say this is the best answer,exactly the way I learned.+1 for @Tinku.I'm a self learner and what I did was I got familiar with the language. Before learning JS first understand how the web is working(don't go deep with that, just the basic knowledge). Then familiar with JS. Do simple projects and look for a JS reference(book). After you got familiar with the JS language now it's time to learn language best practices and then patterns and then frameworks.Always keep up with the language features like subscribing to a newsletter. Help people in stackoverflow, also you can learn from them.
    – Ryxle
    Jun 5, 2014 at 4:28
1

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/

0

This is a really great read:

https://developer.mozilla.org/en/a_re-introduction_to_javascript

0

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 .. :-)

0

I think that Object-Oriented JavaScript by Stoyan Stefanov is an amazing book, but that could just be me.

0

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 ;-)

0

Like with everything else: learn and practice.

How to learn the others already wrote.

-2

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.

-2

You may want to look into major Javascript frameworks such as JQuery and MooTools. Understand the differences between them and pick your favorite.

Here are some links : http://jqueryvsmootools.com/ http://blog.creonfx.com/javascript/mootools-vs-jquery-vs-prototype-vs-yui-vs-dojo-comparison-revised

Not the answer you're looking for? Browse other questions tagged or ask your own question.