3 ms·
OK -I'm convinced. How do I start programming in JavaScript?
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?
- jagan123 15y agoYou can start with the basic tutorials at w3schools.com net.tutsplus.com has some good posts and series running. They have a dedicated category for javascript. Go through them.
- tilt 15y agoDisclaimer: noob here. I found this interesting (and perhaps you're ready to unleash the functional programming already) http://eloquentjavascript.net/contents.html http://eloquentjavascript.net/contents.html
- ColinWright 15y agoThanks. I see by the purple links that I've already skimmed a couple of pages of this, so that's encouraging.
- chalst 15y agoEloquent js was recommended in this HN thread: http://news.ycombinator.com/item?id=2016334 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/ 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.
- gte525u 15y agoCrockford did an OReilly video series that's pretty good at filling in gaps as well.
- J3L2404 15y agoJS has some odd syntax warts so you might want to keep this around for reference. http://en.wikipedia.org/wiki/JavaScript_syntax http://en.wikipedia.org/wiki/JavaScript_syntax
- pbreit 15y agoEloquent 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.
- tobylane 15y agoDo learn Node.js, Coffeescript and JQuery, but don't be dependant on them, they aren't anywhere near as common as say Django.
- laughinghan 15y agojQuery 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/all 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/ 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.
- ColinWright 15y agoSee also: http://news.ycombinator.com/item?id=2713691 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.
- laughinghan 15y agoJavaScript: The Good Parts by Douglas Crockford is highly recommended. To accompany it: http://www.quora.com/What-are-the-most-important-things-to-know-about-JavaScript http://www.quora.com/What-are-the-most-important-things-to-k...
- mikemaccana 15y ago- 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.
- ZackOfAllTrades 15y agoMy 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 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 http://zacharymaril.com/thoughts/constructionGraph.html) . Mess around with Three.js (http://mrdoob.com/blog/post/693 http://mrdoob.com/blog/post/693) and Processing (http://zacharymaril.com/ 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 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.
- ZackOfAllTrades 15y agoOh also use scriptsrc and jQuery UI some. Saves time and headaches.
- mun2mun 15y agohttp://ejohn.org/apps/learn/ http://ejohn.org/apps/learn/ http://bonsaiden.github.com/JavaScript-Garden/ http://bonsaiden.github.com/JavaScript-Garden/ And JavaScript: The Good Parts book as others recommended.
- kungfu71186 15y agoCheck out John Resig. He's a genius with javascript. He also has a few books.