Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
OK -I'm convinced. How do I start programming in JavaScript?
39 points by ColinWright on June 30, 2011 | hide | past | favorite | 15 comments
I program in C and Python. My Python style is definitely imperative in general nature, but functional when I think that paradigm suits, and OO when I think that's appropriate. My colleagues say my programs are clean, clear, effective, efficient, and make their brains hurt.

I know squat about JavaScript.

I have a clean Ubuntu machine with a webserver. What's the most effective way to learn JavaScript?

I'm not looking for dark, arcane knowledge. I'm looking to write well-crafted code to accomplish meaningful tasks on web pages, as well as to solve small, on-the-fly problems, much as I currently use Python, AWK, and Bash.

Suggestions?

EDIT: Not trying to karma-whore here, but if no one upvotes the question it will disappear quickly and we won't get the collective HN wisdom. That would be a shame. Do you want a scape-goat comment?



My path so far with javascript (with examples!):

Desire to make neat web pages. Learn enough jQuery so that you can make something move and change colors with maybe two lines of javascript instead of 20. Keep trying to one up yourself in what kinds of cool shit you can make (I use the term shit because you won't be making anything useful persay, but it will be something that will make friends say "Shit, that is cool. How did you do that?")

Start to learn more and more jQuery until you think in callbacks and events. Use the canvas to make weird patterns (treeowls.com). Make something using Ajax (try the hnsearch api: pretty fun http://zacharymaril.com/HNSearch/Topics/testing-api.html). Try to solve a hard problem with JS that requires lots of computing (some work with Ramsey theory: http://zacharymaril.com/thoughts/constructionGraph.html) . Mess around with Three.js (http://mrdoob.com/blog/post/693) and Processing (http://zacharymaril.com/). Use chrome or firefox with the debugger.

Then get bored with frontend stuff and jump into node on heroku or whatever hosting service is popular but has good documentation. Make a chatroom with a lazy bot(zackbot.com) and a static file server. Look into the database bindings. Look at the stuff DailyJS puts out on node(http://dailyjs.com/tags.html#lmawa old with bugs, but very in depth for the time). Make something neat (still working on that part).

Read a bunch of Javascript/jQuery blogs. If you learn that way, pick up JS The Good Parts. Read anything/everything by Steve Yegge, John Resig, and Ryan Dahl. Use the jquery documentation from the website, then get frustrated with it and use jqapi.com

But that is all based on one approach. It sounds like you are interested in more backend stuff. Starting out with node would probably be what you looking for, but without much know how of how to make things work, you might not get thrilling enough results to actually stick with it. I would say stick with the frontend to learn how javascript works and where it came from and then when you get really really bored go mess around with node.


Oh also use scriptsrc and jQuery UI some. Saves time and headaches.


Disclaimer: noob here.

I found this interesting (and perhaps you're ready to unleash the functional programming already)

http://eloquentjavascript.net/contents.html


Eloquent js was recommended in this HN thread: http://news.ycombinator.com/item?id=2016334

Crockford, 2008, JavaScript: The Good Parts received higher recommendations there. Crockford has a js resouces page: http://javascript.crockford.com/

I guess from I'm looking to write well-crafted code to accomplish meaningful tasks on web pages you are interested in client side, and from solve small, on-the-fly problems, much as I currently use Python, AWK, and Bash also server side. In that thread I linked to, vladd recommends keeping client-side and server-side js programming apart. To be honest, I don't really get why server-side js is so popular, but in any case, I recommend starting with client side.

Aside - I think it's OK to raise this question again, because AFAICS, no one has raised it as an Ask HN post, so this should be more focussed than the thread I cited.


Crockford did an OReilly video series that's pretty good at filling in gaps as well.


Thanks. I see by the purple links that I've already skimmed a couple of pages of this, so that's encouraging.


See also: http://news.ycombinator.com/item?id=2713691

That's the question I thought I was asking, although the comments here are also useful, so I thought I'd keep them separate.


JavaScript: The Good Parts by Douglas Crockford is highly recommended.

To accompany it: http://www.quora.com/What-are-the-most-important-things-to-k...


http://ejohn.org/apps/learn/

http://bonsaiden.github.com/JavaScript-Garden/

And JavaScript: The Good Parts book as others recommended.


- Ctrl Alt I

- Type:

console.log('hello world');

- install node on your ubuntu box. Then type

node

Which starts node's interactive console. Then type:

console.log('hello world');

again.

Congratulations, you're now a javascript programmer, client and server. Go look up Rebecca Murphey's JQuery guide (it's a good Javascript book too) and continue learning.


Eloquent looks like a nice resource. I'd also suggest diving in to jquery pretty quickly since that's what many spend a lot of time in.


Do learn Node.js, Coffeescript and JQuery, but don't be dependant on them, they aren't anywhere near as common as say Django.


jQuery is vastly more common than Django.

jQuery has something like ~80% market share and is unquestionably the most popular JS library: http://w3techs.com/technologies/overview/javascript_library/...

Django, by contrast, is fifth among web frameworks behind some PHP frameworks and Ruby on Rails: http://hotframeworks.com/

I'm having trouble finding numbers about Django among Python web frameworks, but my impression is that it's still not as popular as jQuery.


Check out John Resig. He's a genius with javascript. He also has a few books.


JS has some odd syntax warts so you might want to keep this around for reference.

http://en.wikipedia.org/wiki/JavaScript_syntax




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: