Finally, after all those years, I got around to reading "JavaScript: The Good Parts" - pretty
much from cover to cover.
All in all, a great book! However, it left me even more confused about
how JavaScript sets "
this" than I was before. Fortunately, I found the discussion at
http://stackoverflow.com/questions/3127429/javascript-this-keyword and the article at
http://www.digital-web.com/articles/scope_in_javascript/ which both clarified
open questions for me. But I am pretty sure I will forget JavaScript's context subtleties
fairly quickly, and then I will have to look them up again. Oh well.
Crockford's approach is to focus on a subset of JavaScript which he considers sane,
Of course there is much debate on what belongs into the subset and what doesn't.
For example, Crockford bans the
++ and
-- operators because they remind
him too much of obfuscated C++ code. I did not find this particular advice too convincing, and it
seems
I am not alone.
To experiment with code from the book and test some code of my own, I used the
jsc
command-line JS interpreter on the Mac, and also toyed with
http://jsfiddle.net/.
(On Ubuntu, I guess I could have used
rhino.)
Previous month: Click
here.
Revision: r1.1 - 04 May 2013 - 21:07 - ClausBrod