FAQ Topic - What books are recommended for javascript? (2008-12-02)

62 views
Skip to first unread message

FAQ server

unread,
Dec 1, 2008, 7:00:02 PM12/1/08
to
-----------------------------------------------------------------------
FAQ Topic - What books are recommended for javascript?
-----------------------------------------------------------------------

Although many books have been reviewed, most are quite bad and
cannot be recommended.

The following list of books been approved by some c.l.js regulars
and has been reviewed and discussed on the list.

_"JavaScript: The Definitive Guide,"_ 5th Edition, By David Flanagan.
ISBN: 0-596-10199-6

http://oreilly.com/catalog/9780596101992/toc.html

http://www.oreilly.com/catalog/jscript5/errata/

_"JavaScript Pocket Reference,"_, By David Flanagan.
ISBN-10: 1565925211, ISBN-13: 978-1565925212

http://oreilly.com/catalog/9780596004118/toc.html

http://oreilly.com/catalog/9780596004118/errata/


--
Postings such as this are automatically sent once a day. Their
goal is to answer repeated questions, and to offer the content to
the community for continuous evaluation/improvement. The complete
comp.lang.javascript FAQ is at http://jibbering.com/faq/index.html.
The FAQ workers are a group of volunteers. The sendings of these
daily posts are proficiently hosted by http://www.pair.com.

Peter Michaux

unread,
Dec 3, 2008, 12:42:10 AM12/3/08
to
On Dec 1, 4:00 pm, "FAQ server" <javascr...@dotinternet.be> wrote:
> -----------------------------------------------------------------------
> FAQ Topic - What books are recommended for javascript?
> -----------------------------------------------------------------------
>
> Although many books have been reviewed, most are quite bad and
> cannot be recommended.
>
> The following list of books been approved by some c.l.js regulars
> and has been reviewed and discussed on the list.
>
> _"JavaScript: The Definitive Guide,"_ 5th Edition, By David Flanagan.
> ISBN: 0-596-10199-6
>
> http://oreilly.com/catalog/9780596101992/toc.html
>
> http://www.oreilly.com/catalog/jscript5/errata/
>
> _"JavaScript Pocket Reference,"_, By David Flanagan.
> ISBN-10: 1565925211, ISBN-13: 978-1565925212
>
> http://oreilly.com/catalog/9780596004118/toc.html
>
> http://oreilly.com/catalog/9780596004118/errata/

Crockford's book is worth mention. It has been "reviewed" and
"discussed" on the group. It is a good book written by a thoughtful
programmer sharing valuable insights.

Peter

David Mark

unread,
Dec 3, 2008, 1:31:53 AM12/3/08
to

I haven't read them, but I wondered how Crockford's books didn't stack
up. What constitutes a review?

[snip]

John G Harris

unread,
Dec 3, 2008, 3:17:57 PM12/3/08
to
On Tue, 2 Dec 2008 at 21:42:10, in comp.lang.javascript, Peter Michaux
wrote:

<snip>


>Crockford's book is worth mention. It has been "reviewed" and
>"discussed" on the group. It is a good book written by a thoughtful
>programmer sharing valuable insights.

It's been mentioned but not truly reviewed.

In my opinion the book is too opinionated to be called good. The author
shows several signs that he doesn't understand enough about javascript
and doesn't understand much about the mainstream OO languages.

Even if you don't agree with that you have to agree with what he says in
the preface :
"This is not a book for beginners".

John
--
John Harris

dhtml

unread,
Dec 6, 2008, 3:45:12 AM12/6/08
to

You should post up your review, too.

It is a good book written by a thoughtful
> programmer sharing valuable insights.
>

Although there are code examples, I do not feel that this book serves as
a guide for how to program javascript.

It contains useful information, but would do better to mention specific
issues with implementation bugs.

Doug advocates modifying built-ins' prototypes.

In particular, he declares Function.prototype.method.

Function.prototype.method = function (name, func) {
if (!this.prototype[name]) {
this.prototype[name] = func;
}
}

The arguments against modifying built-ins' prototypes have been
discussed. For example, it is often said that "don't modify what you
don't own" or "others might not be familiar with your version of a
method (for example, a toFixed method that returns a prepended +/- sign,
or does rounding). Not mentioning such arguments seems biased. Instead,
the arguments should be presented to the reader.

The book needs more technical review. Here's a little.

pg 39: Explanation of closures:
The "bad" example uses the variable |i|, the "better" example uses the
variable i, but in the body of the function, has |alert(e)|, instead of
|alert(i)|. The changed variable prevents the example from showing that
the explanation is correct.

The book mentions implementation problems with RegExps. If it is going
to mention problems with implementations, it should be much more
thorough about it. In particular, the form of using an identifier in a
FunctionExpression results in JScript interpreting a function expression
and a function declaration which applies to the example of the "function
statement" (I have explained in previous threads why this is the wrong
terminology).

The regular expression part has a mistake.

var parse_number = /^-?\d+(?:\.\d*)?(?:e[+\-]?\d+)?$/i;

Matches all of:
parse_number.exec('3.');
parse_number.exec('3.E3');
parse_number.exec('009.E0');
parse_number.exec('-0.3');

Pg 55. The explanation of "parts" is a good explanation of the
essentially good part about javascript.

I agree that it is a pretty good book, but could be improved.

Garrett

> Peter


--
comp.lang.javascript FAQ <URL: http://jibbering.com/faq/ >

William James

unread,
Dec 6, 2008, 5:11:09 AM12/6/08
to
dhtml wrote:

> > Crockford's book is worth mention. It has been "reviewed" and
> > "discussed" on the group.

>
>

> The regular expression part has a mistake.
>
> var parse_number = /^-?\d+(?:\.\d*)?(?:e[+\-]?\d+)?$/i;
>
> Matches all of:
> parse_number.exec('3.');
> parse_number.exec('3.E3');
> parse_number.exec('009.E0');
> parse_number.exec('-0.3');

Using MonkeyScript and jslibs.


LoadModule('jsstd') // Gives us Print().

// No octal or hex numbers are allowed.
function ok( str )
{ var re =
/^0$|^[-+]?(?:0\.\d+|[1-9]\d*(?:\.\d+)?)(?:e[-+]?\d+)?$/i
return !!str.match(re)
}

var s
Print('--- First, the bad.\n')
var bad = '00|3.|3.2.5|3.E3|3e|3e3.2|009.E0|07|.8'.split('|')
for each ( s in bad )
Print( s, ' ', ok(s), '\n' )
Print( '--- Now, the good.\n')
var good = '0|-0.3|0|9|+3.14|2.72|44e-1|7.5e22'.split('|')
for each (s in good)
Print( s, ' ', ok(s), '\n' )

--- output ---
--- First, the bad.
00 false
3. false
3.2.5 false
3.E3 false
3e false
3e3.2 false
009.E0 false
07 false
.8 false
--- Now, the good.
0 true
-0.3 true
0 true
9 true
+3.14 true
2.72 true
44e-1 true
7.5e22 true

Reply all
Reply to author
Forward
0 new messages