10 ms·
Learning JavaScript - my experience and advice
- Helianthus 14y agoThe attached Learn Backbone.js Completely article is also very good. Angular has _huge_ obstacles for dev usability when Backbone's source is so accessible you can use it to help learn js.
- ianstormtaylor 14y agoSo true, that was one of my favorite things about Backbone. I don't even really look through the docs anymore, just jump straight to the source. It's incredibly well done.
- mac1175 14y agoThis was one of the reasons why Backbone was my first choice compared to the other "MVC" frameworks. The documentation was simple and I think some the handling of Views helped you mentally organize your DOM manipulation code versus having a file riddled with various event bindings with possible selector conflicts hidden. Right now I am working with AngularJS but the documentation can be cryptic at times. I didn't have resources like John Lindquist's site (http://egghead.io http://egghead.io), I may have suck with BackboneJS. It is still a great framework but AngularJS, after gaining experience, has some amazing features.
- jurassic 14y agoI wish somebody would write a post like this for Ruby. Trying to craft a personal study plan of the best, most current resources from the large number of apparently high-quality offerings is difficult for a newcomer to the language. I'm operating on the assumption that success is mostly path-independent (just start doing stuff and going through resources, and you'll learn), but it still feels like a random walk approach to learning sometimes. I'd also like a list of critical tools for programmers new to the Ruby langauage. These things don't always get highlighted in beginner resources because of the need to hand-hold on fundamental concepts for people who've never programmed. For instance, I wish when I'd learned Python that somebody would have told me right at the beginning to install ipython, virtualenv, pip, etc. Edit: Wow. Thanks, guys, for all the good recommendations.
- thetabyte 14y agoThe good news is, if you're doing Ruby in order to do Rails, there is such a thing. http://ruby.railstutorial.org/ruby-on-rails-tutorial-book http://ruby.railstutorial.org/ruby-on-rails-tutorial-book (Include every section labeled optional) For general Ruby though, less so. I've heard good things about http://tryruby.org/ http://tryruby.org/, and I liked the Pickaxe book (though I didn't love it).
- trustfundbaby 14y agoFor Rails, I'd recommend, in this order 1. Agile Web Development with Rails 2. The Rails Way I've heard good things about "Beginning Rails 3", but I haven't read it myself, I'd pop that up to the top of the list if Agile Web Development with Rails isn't working for you.
- thehermit 14y agoI can give you my personal path I took when learning a few years ago if you don't mind starting with rails. Start with Michael Hartl's Rails Tutorial [1]. I went through the rails 3 version with zero knowledge of ruby and you should feel very comfortable with the basics when you are done. After that I read The Well-Grounded Rubyist [2]. Having used some ruby now I found the book easy to get into. It's a little dated but should still cover everything you need at this point. Lastly I read Eloquent Ruby [3]. I highly recommend this book and is easily my favorite programing book. [1] http://ruby.railstutorial.org/ http://ruby.railstutorial.org/ [2] http://www.amazon.com/Well-Grounded-Rubyist-David-Black/dp/1933988657/ http://www.amazon.com/Well-Grounded-Rubyist-David-Black/dp/1... [3] http://www.amazon.com/Eloquent-Ruby-Addison-Wesley-Professional/dp/0321584104/ http://www.amazon.com/Eloquent-Ruby-Addison-Wesley-Professio...
- effbott 14y agoEloquent Ruby is an excellent book for beginners. http://www.amazon.com/Eloquent-Ruby-Addison-Wesley-Professional/dp/0321584104 http://www.amazon.com/Eloquent-Ruby-Addison-Wesley-Professio... If you just want to learn some basics of Ruby without diving into an entire book, check out Ruby Monk. All of the tutorials are interactive: http://rubymonk.com/ http://rubymonk.com/
- nickporter 14y agoIt's like people don't understand that JavaScript is a language. The browser is just giving you a JavaScript API.
- ryanSrich 14y agoI tried a similar approach and kept going back to jQuery first. For some reason it was learning jQuery that aloud me to really understand Javascript. I really like the way codeschool teachers their javascript track.
- pyvek 14y agoProfessional Javascript for Web Developers is really an excellent book. Also, I would like to mention a blog post [1] by Richard Bowell which was front-paged here recently who also recommends the same book. I'm currently learning JavaScript and the thing that sucks is reading about IE incompatibility/workarounds on almost every other page of the book. Any advice on how should I handle it? Is it really necessary to keep in mind all those quirks or can I skip through those material right now and learn what works on most browsers? [1] http://javascriptissexy.com/how-to-learn-javascript-properly/ http://javascriptissexy.com/how-to-learn-javascript-properly...
- alxndr 14y agoSkip it.
- deleted 14y ago[deleted]
- ianstormtaylor 14y agoDefinitely skip it. You'll learn them one by one later as you run into them in your code. Or by the time you need to use most of them, IE's quirks won't matter for you target audience.
- richardofyork 14y agoYep, skip those pesky IE compatibility issues, except, if you expect to target IE <= 8, you should definitely get the shim library at the link below. It provides compatible IE functions for all the common native JS methods and functions that missing in IE <= 8. Then you never have to worry about IE again. https://github.com/kriskowal/es5-shim https://github.com/kriskowal/es5-shim
- tomku 14y agoSkim the IE stuff, and use the book as a reference manual if you need to implement cross-browser functionality yourself. It's important to have a general idea about what won't work if you need to support IE in the future, but you don't need to know every single detail.
- gavinflud 14y agoI read "JavaScript: The Good Parts" after having been using JavaScript for a couple of months and still found it overwhelming. Douglas Crockford moves through the topics at a very fast pace. However, after a few more months of learning the language I went back to the book and was immediately thankful for how quickly he moved from topic to topic. I understood the references and was receiving quick tips on what to do and what to avoid doing with all the different elements that make up the language. Also, I agree with the author, Professional JavaScript is the ultimate JavaScript book in my opinion.
- just2n 14y agoTGP is mostly dogma. The title should make that very clear, but unfortunately, as usual, Crockford is short sighted so the title of his book is misleading, implying you might learn something about the language by reading it. A much more appropriate title would've been "JavaScript: Crockford's Best Practices for Experienced JavaScripters", or "What's Wrong With JavaScript According to Crockford." Then it's pretty clear what the book is doing, and doesn't trick readers into thinking it's an introductory or learning book. A few of Crockford's opinions are fairly widely accepted as good advice, but much of it is controversial at best, and in practice incorrect or misguided. If you are considering buying it, just watch the talk instead: http://www.youtube.com/watch?v=hQVTIJBZook http://www.youtube.com/watch?v=hQVTIJBZook. As for the article: it's mostly sound advice. I will reiterate reading the source to underscore and backbone. I started recommending this lately to people after they get comfortable with the language. Many popular patterns and techniques are used in these code bases and they're very approachable from a reading perspective. I read both a few months ago to get up to speed on a new project and I found it quite enjoyable compared to reading the likes of jQuery or Angular.
- georgemcbay 14y ago"JavaScript: The Good Parts" is a fantastic book, but anyone telling you to read it if you're coming at JavaScript as your first language is doing you a horrible disservice. It is a fantastic book for learning to avoid being bitten by all of the stupidity in JavaScript if you're used to programming in sane languages, but it isn't a tutorial or "Learn to Program" book by any stretch of the imagination. To be completely honest, I'm a bit horrified people are learning JavaScript as a first language at all. The language does indeed have its "Good Parts" and it is incredibly useful because of its ubiquity, but I just wonder how many young brains are going be hardwired to think some of the design choices (the way block scoping works/doesn't work, equality, lack of modules, etc, etc) in current JavaScript versions are normal, when in fact they are very unfortunate.
- simonlc 14y agoJavaScript was my first language. I learned allthe basics of programming in it. I quickly got frustrated because I still did not know how to make anything complex. I switched to python and it almost was like easymode. With python I was much more able to learn how to make things. Now I'veswitched back and I hate it. I'm continually forced to go out of my way with js to make things work properly. Thought now at least I can work on html projects that I can share, python on the other hand can't do that.
- hmart 14y agoAside from the "Good Parts" debate, the Crockford JS site is extremely insightful http://javascript.crockford.com/ http://javascript.crockford.com/
- kevincennis 14y agoI learned JavaScript first, and I think in many ways I'm actually better off for it. Anyone who's serious about JS hears constantly about the problems of lexical scoping, type coercion, lack of modules, etc. When I moved on to learning PHP and Python, I largely knew what to expect - and found them both pretty easy (aside from PHP's standard library being ENORMOUS and impossible to memorize). On the other hand, I've seen people coming from classic OOP languages really struggle with things like first class functions and prototypal inheritance. I don't think the problem is that people are learning JavaScript as a first language. I think the problem is that a lot of people who write JS don't ever really learn it.
- shawndrost 14y agoJavascript's secret weapon[1] -- especially for beginning programmers -- is its dev tools. If you learn JS' debugging toolkit early on, it will accelerate your learning in general. I recommend Code School's "Discover DevTools" course [2] for beginning devs, but I'm not aware of a high-quality introduction for experienced devs. Shameless plug: I teach at a school for JS devs named Hack Reactor. If rewriting Underscore as a learning tool sounds like fun, you should apply. http://hackreactor.com http://hackreactor.com [1] until now. [2] Chapters 3-4. http://discover-devtools.codeschool.com/chapters/3 http://discover-devtools.codeschool.com/chapters/3
- minikomi 14y agoIndeed. Learning that debugger; will stop the interpreter at any point you like, with console scoped at that point, has sped up my JS'ing greatly
- grinnick 14y agoWait you can what!?? Holy moly, I've been writing JS for like 3 years now and I never knew this.
- chunkbot 14y agoHoly shit! I've been programming in JavaScript for years and never heard about the debugger statement. This looks great for really understanding the details of JavaScript's object model.
- andrus 14y agoI'll second the author's recommendation of Effective JavaScript by David Herman. I've found it very helpful: http://effectivejs.com/ http://effectivejs.com/
- zenocon 14y agoI'll third this recommendation. Herman's book is succinct, clear, and well-written. Although I wouldn't recommend it as your first intro to JS; If you've already been hacking in JS for a while, and want to take it to the next level, this is the book to buy.
- akurilin 14y agoI've had to learn JS pretty fast just a couple of months ago and from what I can read I managed to do almost exactly what Derek did, same exact books and all. Professional JS is indeed fantastic and is highly recommended. Same thing as far as reading Underscore and Backbone source. For fun, try implementing something in Backbone. It's certainly one way of assessing if you're at all proficient in the language.
- mark_l_watson 14y agoI tried doing a total immersion in JS recently by coding up small learning projects for Ember.js, Ember.js + Node.js, Node.js + Express, and some general experiments while reading "Secrets of the JavaScript Ninja" (I like this book, BTW). All that said, I did a 90 minute sprint with Clojurescript tonight, and as awkward as it may seem to use an intermediate language, the development process is really nice. Whether I am modifying server side or client side code, the edit, try it cycle is very quick (a second or so). I have found that if I make little changes in one cycle, keep a browser JS console open with logging from client side code, and keep repls open for both the server side Clojure code and the client side Clojurescript code then I have a good window into both sides of a web app. However, Node.js with either something like Express or (if you are brave) Ember.js is really nice also. I understand why people like Node.js.
- straws 14y agoEloquent Javascript is absolutely the right starting point, I'm glad there's been a shift from recommending The Good Parts to that one. It was linked here the other day, but Superhero JS is another great "what is the path to javascript mastery" lists: http://superherojs.com/ http://superherojs.com/
- Alex3917 14y agoI definitely agree on JavaScript: The Good Parts -- it's quite possibly the single most over-rated book I've ever read. There is literally a Stack Overflow thread devoted to just about every single code example and paragraph in the book, because no one has any idea what he's talking about. And even the JavaScript gurus on SO can't figure out what he's actually trying to say a good percentage of the time. I'm sure it would be a great book if I were already pretty good at JavaScript, but as a first book it's just awful. I had much better luck with a HeadFirst book that covered JavaScript, even though that is a little too dumbed down at times. I was then able to then go back and have a much better appreciation of what Crockford was trying to say.
- WickyNilliams 14y agoYour second paragraph is nonsense. Any JS expert should be able to understand every point made in that book, by the very definition of expert. Your third paragraph is completely sensible however. The Good Parts is horrible if you're a beginner programmer, and I'd definitely recommend against it. But if you have a CS degree or years of programming experience, it should not cause you trouble - it's a great, terse intro to JS that'll get you up and running in no time. The worst book to learn from is JavaScript: The Definitive Guide [1]. It's unnecessarily lengthy (1000+ pages!) and attempting to learn from that has dissuaded more colleagues from JS than I care to remember. [1] http://shop.oreilly.com/product/9780596805531.do http://shop.oreilly.com/product/9780596805531.do
- Alex3917 14y agohttp://stackoverflow.com/search?q=%5Bjavascript%5D+crockford http://stackoverflow.com/search?q=%5Bjavascript%5D+crockford
- joelhooks 14y agoWhen I was learning JS last year, coming from a background using other languages (Python, Actionscript, Java), this was the first book I read. It helped me immensely. Obviously AS3 shares a LOT of DNA with JS, but Crockford's funnel paved the way. Certainly not the be-all-end-all, but for a book I was able to read in an afternoon, I give it high marks.
- philipwalton 14y agoJavaScript has three main features that commonly trip up people from other languages. If you understand these three things, you'll be way ahead of the curve: 1) What `this` means in a function context https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Operators/this https://developer.mozilla.org/en-US/docs/JavaScript/Referenc... 2) The prototype chain and prototypal inheritance https://developer.mozilla.org/en-US/docs/JavaScript/Introduction_to_Object-Oriented_JavaScript https://developer.mozilla.org/en-US/docs/JavaScript/Introduc... 3) Function closures and variable scoping https://developer.mozilla.org/en-US/docs/JavaScript/Guide/Closures https://developer.mozilla.org/en-US/docs/JavaScript/Guide/Cl...
- reyan 14y agoAnother book which I really liked is JavaScript Patterns by Stoyan Stefanov.
- pacomerh 14y agoOh yeah, I was gonna write the same thing. This is a great book. I'm actually going over it again to reafirm.
- tantalor 14y ago> you'll love looking at the code to two very popular and powerful JavaScript projects: Underscore.js, Backbone.js Is that a joke? I can't stand reading the source of those two libraries, even with the pretty two-column documentation. There have got to be better examples of readable JavaScript.
- taurath 14y agoThanks a lot for this post. As a relatively new web dev mostly working in jQuery (I get stuff to work right and be relatively fast, but thats about it), I've been very curious about where to go next.
- nlh 14y agoNobody has commented on the suggestion to aid learning with Spaced Repetition Software - specifically the Anki open source program. Anybody try or use this technique? It looks interesting and sounds reasonable and effective. I took a peek at Anki but have to admit it looks messy (and the iOS app is $25, which is def. on the high end of the iOS pricing scale). I'd be curious to hear others' experience in this area...
- invalidOrTaken 14y agoI haven't used SRS for js specifically, but I've been using it lately to cement certain Ruby concepts. Best advice I can give is that it's totally worth it, but don't take shortcuts when authoring cards. Take the time to separate concepts into bite-sized, more simple (Rich Hickey simple, not "easy" simple) concepts, and write questions that elicit that knowledge. Also, Anki is free for both desktop (every OS) and Android.
- conradcb 14y agoI haven't used it for programming languages (though I intend to the next time I learn one), but I used it for my maths degree (for sit-down exam at the end of the year), and it seemed to be very effective. The danger is always that it can be time consuming to create the content for it. Anki does look a bit raw, but worked absolutely fine for me (though transferring LaTeX-ed decks between devices was a hassle). There's also memrise.com, which mostly focuses on languages, but allows users to create content on any subject. It's also more easily shareable there, I think. In any case, the science behind SRSs is good, and in my experience it helps a lot with memorisation!
- jole 14y agoAnki is great to recapitulate what you already know. At the moment, I'm trying to use it for learning new stuff. I am preparing for lpic-1 certification exams, and I use only Anki as tool to study. For now I'm really satisfied.
- zimpenfish 14y agoI'm trying to use Anki to learn various things and whilst it does seem to be working, some of the decks you can download could do with a firm hand on the layout / design tiller. e.g. the C one presents the code in an awful centred and line-broken fashion which completely obliterates the location of significant comments and the like. (But I believe the SRS people recommend you make your own decks as part of the process.)
- blacksqr 14y agoThe world would be a much better place if there were more straightforwardly helpful posts like this. +1,000,000 internets.
- kybernetikos 14y agoI've recently made something that I hope to use to teach our new hires (who will all have programmed before, but probably not in javascript) the ins and outs. It's called "New to JS" and is available on github at http://caplin.github.com/new2JS http://caplin.github.com/new2JS and the source is https://github.com/caplin/new2JS https://github.com/caplin/new2JS. Keen to get any feedback / pull requests.
- fredyr 14y agoThis is really a good set of resources for learning Javascript. In addition I want to add the "Learning to love Javascript" presentation by Alex Russell from Google Code 2011, http://www.youtube.com/watch?v=seX7jYI96GE http://www.youtube.com/watch?v=seX7jYI96GE that I felt really boosted my learning curve (or at the very least kept me passionate about JS to continue learning as much as I possible could)
- Millennium 14y agoTGP isn't a good book for learning JavaScript the first time, it's true. The time to read it is when you've been doing this for a while, and it's time to "unlearn what you have learned" before you can move on to the next level of expertise. There's a lot of dogma in the book, but that's not bad in the appropriate context: most people will find something to follow in its pages, but most people will also find something to question. Both experiences are valuable, especially for someone preparing to "take the next step," as it were.
- mtgx 14y agoCodeCademy's course is very good, I thought.
- luketych 14y agoI think the first spaced-learning algorithm was actually SuperMemo, developed by Piotr Wozniak. The rest just copy his algorithm.
- pdm55 14y agoWilton "Beginning Javascript" is the essential bits of JS. Zakas "Prof JS for Web Developers" is comprehensive. Strom "3D Game Programming for Kids: Create Interactive Worlds with Javascript" teaches JS by creating games.