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.
Languages like C++, Java, C#, Objective-C and Smalltalk have very well-defined and consistent ways of declaring classes, inheritance relationships, instantiating objects, using objects, and so forth. With some experience, it becomes extremely trivial to quickly understand and work with such code, even when it was written by other developers far away or long ago.
To see what I mean, look at the examples at:
Those are three different ways of doing the same thing (and one of them also has non-obvious resource consumption impacts). Those are a very basic case, as well, without even any inheritance. This lack of consistency may not seem like a big deal when it comes to simple examples like that, but it does quickly become an issue in any code written by more than one or two developers, and meant to be maintained for years. Some will claim that coding standards will help here, but they do absolutely no good once integrating code developed independently of said coding standards.
My best advice would be to maybe read though one of the more popular libraries though I don't know which one to recommend. There's a level of elagance there I rarely see in C++
He argues (and I agree) that prototypal inheritance isn't complicated unless you're coming from a very classical inheritance background.
Having an understanding of how C++ types, strings, structs and finally objects all impacted the stack and memory, then being able to actually create something in x86 let me 'see' how classes create objects, and also got me over the 'how do pointers work?!' hurdle.
It might be entirely counter-intuitive, but learning assembly was the key to me being able to shift OO-gears. Today I write in PHP and JS, and the only thing that I find myself stumble over when moving back-and-forth are weird things like the `this` scope of setTimeout returning to global space when invoked locally.
U2> He argues (and I agree) that prototypal inheritance isn't complicated unless you're coming from a very classical inheritance background.
Aren't they the same point?
Your concerns echo those of Edsger Dijkstra when he discussed the educational shortcomings of popular PLs in 1975:
For what it's worth, I share your dismay. However, I (and many others) cut my teeth on BASIC -- turned out just fine.
Heck, thousands of programmers (myself included, come to think of it) got started on programming because of "DHTML" and script kiddy DOM manipulations back in the days of Netscape. It was a gateway language. Fortunately I learned the fundamentals more thoroughly in Scheme...
In fact back then you had to pay for C compilers usually, whereas BASIC interpreters were often free with the platform so it was fairly common to have never used anything else.
That became further cemented with Visual Basic it's legions of copy/paste & visual designer oriented developers.
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
 until now.
 Chapters 3-4. http://discover-devtools.codeschool.com/chapters/3
I look forward to applying to Hack Reactor when it's financially feasible! :)
Chrome instructions - https://developers.google.com/chrome-developer-tools/docs/ov... ... others are easy enough to find
Just whatever you do, remove the debugger (and console.log) statements before committing/deploying!!! I've seen this too many times and it's not nice when you end up throwing exceptions in older browsers that have no idea what these statements mean.
1) What `this` means in a function context
2) The prototype chain and prototypal inheritance
3) Function closures and variable scoping
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.
For someone who has programmed in C, C++, C#, Java, Python, Ruby etc., it's the perfect book: it succinctly explains the good and unique parts of JS. It's actually a bit too long in my opinion, the railroad diagrams and syntax parts can be skipped by the target audience.
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.
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.
I will always read anything he writes. Love his style. Now that I am thinking about it, I feel like re-reading that book.
The most important thing to remember, when you are learning programming for the first time, is that the process is very, very long. You make A LOT of mistakes and it can be INCREDIBLY frustrating. But....once you push through, and actually validate that you know what you just learned and actually figure stuff out...I think there are very few highs that rival that rush.
It's weird....but it is EXTREMELY satisfying. I think because the journey is so hard, that makes the discovery of the solution all the more pleasing.
So, I would say....just prepare your mind that you have a lot of long nights, and problems that may take you days/weeks/months to "fully grok". Once you get in that mindset and are prepared to slog through, you will make it and be much better off for it.
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:
I would recommend in this order
1. Beginning Ruby (From Novice to Professional)
2. Eloquent Ruby ... then
3. The Well Grounded Rubyist
(Include every section labeled optional)
For general Ruby though, less so. I've heard good things about http://tryruby.org/, and I liked the Pickaxe book (though I didn't love it).
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.
Start with Michael Hartl's Rails Tutorial . 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 . 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 . I highly recommend this book and is easily my favorite programing book.
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...
Also, Anki is free for both desktop (every OS) and Android.
That said, if you want to give it a shot, I'd suggest starting with the desktop version of Anki. Make your own deck, because making a deck is its own form of studying. Use it for a while, and if you feel that it's something that you want to invest more time in, get the mobile app.
Oh, one other thing I'd like to mention about SRS. SRS techniques are designed to manage HUGE numbers of cards, ranging from a few hundred to tens of thousands. If you have less than a hundred or so cards, it's just a really smart flash card system - you could review all the cards every couple days without much trouble. People who really get into SRS tend to use it for everything, because it's an easy way to integrate more knowledge into their existing knowledge-management framework. As such, you should be careful about recommendations for using it for one particular field. The people doing the recommending usually have lower friction regarding adding a couple hundred programming cards to their deck than you will as a beginner.
1 - http://ankiweb.net/
StickyStudy is cheaper and so far works fine with my < 200 element deck.
Only problem I had is that it sometimes crashes after searching for a word and then clearing the search-box.
The way I use it is to just create a card or two for every useful trick, library function, command line option or whatever I encounter that looks interesting or useful. The area it worked best so far is git - I no longer fumble for that elusive option to 'log' or 'diff' that I know exists but I just cannot remember it because I use it just rarely enough to forget it between use cases.
I do not create large decks upfront so I'm using it as a notepad rather than study book.
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!
I think he has some good points; you can definitely program a lot faster in a language in which you have memorized much of the standard library and the API/frameworks you are using heavily. I don't really think SRS has a place when it comes to learning a new language. To me it makes more sense once you are certain you are going to specialize in a language/platform. I am still yet to try it.
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.)
In a nutshell, pressing the button this extension adds to Anki either pastes the contents of your clipboard as syntax-highlighted code, or applies syntax-highlighting to the text you have selected.
This makes code much, much easier to parse, especially when using Anki on a mobile device.
On the plus side, checking the app to see if such an option exists found a bunch of options I didn't know about that will make my experience more pleasant. Ta.
It's called "New to JS" and is available on github at http://caplin.github.com/new2JS and the source is https://github.com/caplin/new2JS.
Keen to get any feedback / pull requests.
For fun, try implementing something in Backbone. It's certainly one way of assessing if you're at all proficient in the language.
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.
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.
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.
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.
Zakas "Prof JS for Web Developers" is comprehensive.
Angular has _huge_ obstacles for dev usability when Backbone's source is so accessible you can use it to help learn js.