What would be the best way for an aspiring programmer with not much prior experience to learn Javascript?

Someone asked me this question on Askolo

The best way to learn programming is to do it. I think there’s two tracks that you need to pursue: learn the fundamentals of programming (aka, the boring, but important stuff), and a project you want to do.


No one likes doing drills, but if you haven’t done programming before, you need the basics, like how to do if/then statements and loops. It’s like having to know what a steering wheel is before you drive. I suggest getting a javascript book for beginners. 
http://www.amazon.com/s/ref=nb_sb_noss_1?url=search-alias%3Daps&field-keywords=javascript+beginners&x=0&y=0

Or if you’re a cheap bastard, you can start with http://www.w3schools.com/js/ which gives you examples you can play with right in the browser! It’s important that you play with the examples. That’s how you get to know how it works! Change something, see what it does!

The other half is to pick a simple project that you’d like to do. The idea is to pick something that’s not too hard for you (important!), but something you’re really really excited about building (double important!). It can be stuff like make every image in a webpage be upside down as a prank for your friends. Or implement this XKCD comic: http://xkcd.com/1031/ I can’t really tell you what to pick, since you need to pick something exciting to you, so you’ll want to work on it, even when your friends ask you out for a kegger. But also make sure it’s doable. That’s hard to judge when you’re just starting out, but one way is to ask a programmer friend that can appreciate beginners. 

After you get the basics from w3schools, I’d say it’s important to learn JQuery. http://jquery.com/It’s the sane was of manipulating the stuff you’d see on the page. 

After that, you’re ready to tackle:
http://ejohn.org/apps/learn/
I think it’s a really good tutorial on the little gotchas of Javascript. It may take a little while to get through it, but feel free to come back to it, as you work on other stuff.

Javascript is a surprisingly good language, but it has lots of warts. Learn about what the good parts are:
http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742

Remember to do the following when coding:
– Write a little, test a little. That way, you know what you changed since last time that broke it. Don’t try to write the entire thing all at once, and then run it. 
– Make sure you check that you’re not missing semicolons, and all your braces, parens, and brackets match. Computers are finicky.
– If you have questions or get stuck, search on stackoverflow.com They have lots of answers. 


Good luck!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s