Crockford's JavaScript, The Good Parts (a book review).

G

Gregor Kofler

lorlarz meinte:

That's a hoot. You are showing off this ...er... stuff? Seem to be
contenders for a crap compo.

To get me right: There's nothing wrong with your examples, as long as
you wouldn't use them to "demonstrate" your proficiency in JS and goof
on others. Normally I'd say "can be improved" - in this case I'd rather
resort to "sod off!".
something and do something and that people can use. Where are
Crockford's??

Crockford wrote JSLint. Crockford wrote JSON. Crockford wrote JSMin.
Crockford wrote...

Let's see: My XHR communication utilizes JSON (as do zillions of other
web pages). I check my JS with JSLint to track down nasty, hard to find
bugs, and I use JSON to compress my files. All useful stuff. No need for
lolarz' scripts yet.
I believe he has none. (By the way, I use a JS library only in one of
the
above programs).

jQuery. A wise decision. In this case you should rave about Resig's
books and leave Crockford to the JS aficionados.

Gregor
 
G

Gregor Kofler

lorlarz meinte:
Please put the program that manipulates the DOM using only what is
in Crockford's book up on the Internet. Give us the address. Let's
see that program which changes the DOM in interaction with the user.

I suppose it's your lacking in German, otherwise you'd have already
found the link. But then... you are incapable to quote properly. Perhaps
this is just over your head.

I do not think you are telling the truth, since there is nothing in
Crockford's book about it, whether directly manipulating the DOM or
via
CSS.

I didn't need Crockford for *that*.


Gregor
 
T

Tim Streater

Joost Diepenmaat said:
[ reformatted for better reading ]
Javascript is NOT independent of the DOM and CSS _if_ you look at
many of the functiions in the language ARE and what they are FOR.
There are many functions for walking the DOM, creating DOM elements,
adding those elements dynamically to the page and another whole
large set of functions also _in the language known as JavaScript_
for manipulating CSS and thus dynamically affecting the page that
way.

Talk crap all you want. Those functions are NOT in the language. They
may or may not be provided by the host environment, if the host
environment is a browser, and feels like it.
In the sense YOU speak, JavaScript is INDEPENDENT OF EVERYTHING. See
how
little sense that makes?

It makes perfect sense. Just like the C language doesn't provide I/O.
Some day when YOU, like me, start making actual full-blown
Javascript applications and stop being script kiddies, you will
appreciate this point. People: start making Javascript
Applications!!

Like the "click a letter and a number" "application" you made? Please.
And, finally (with respect to your material quoted below):
Javascript's MAIN use is for use in the web browsers (check your
history, if you are unclear about this). The language was in NO WAY
designed to be independent of the DOM, etc. ECMA standards
NOTWITHSTANDING.

Designed or not, right now it definitely IS not bound to web browsers
specifically, and especially not to the DOM - or do you really tink
actionscript is marginal technology? Also check Netscape's own
server-side javascript initiative, which IIRC was created very soon
after netscape's browser-side javascript.

Without wishing to get embroiled in the above argument, can you indicate
why I might want to use JavaScript *not* in a browser (I mean for other
than say teaching purposes)? Why might I use it for general purpose
scripting instead of, say, PHP?
 
S

Stanimir Stamenkov

Tue, 19 Aug 2008 20:15:52 +0100, /Tim Streater/:
Without wishing to get embroiled in the above argument, can you indicate
why I might want to use JavaScript *not* in a browser (I mean for other
than say teaching purposes)? Why might I use it for general purpose
scripting instead of, say, PHP?

Because you don't have to learn yet another language, for example.
You may reuse code for optional client-side form validation on the
server-side (depending on the framework), as another example.
 
J

Joost Diepenmaat

Tim Streater said:
Without wishing to get embroiled in the above argument, can you indicate
why I might want to use JavaScript *not* in a browser (I mean for other
than say teaching purposes)? Why might I use it for general purpose
scripting instead of, say, PHP?

Heh, I wouldn't use PHP for general scripting :)

Javascript is quite a good as an embedded language, which is what it
is in a browser too. There are a few webservers that support
javascript as a scripting language, which I guess makes sense if
you're already using a lot of javascript at the client - less hassle
converting data back and forth.

Then there's Flash/actionscript - which usually runs in a browser but
has a completely different host object model, and adobe is working
hard at pushing flash/flex/air to the desktop.
 
J

Joost Diepenmaat

lorlarz said:
Saw your 'program'. Not a program.
Whatever.

Running, doing stuff continuously
in Javascript
start to result with several significant steps along the way -- that
is a
program.

What the **** are you talking about?
Trouble is, yours is just script kiddie stuff. You don't
appreciate my point about key parts of javascript because you do not
do
javascript programs. I do JavaScript programs.

What points would that be? All you've demonstrated up to now is your
complete and utter ignorance. Oh, and your arrogance - strange how
those things seems to go together.
 
M

Michael Wojcik

Joost said:
Talk crap all you want. Those functions are NOT in the language.

Indeed (and FWIW I agree with you regarding Crockford's book). However:
It makes perfect sense. Just like the C language doesn't provide I/O.

This is incorrect. The C standard includes the standard library, which
includes stdio. See ISO 9899:1999.

A better example might be that C does not include any support for
GUIs, the great number of GUI programs written in C notwithstanding.

That said, I don't think you're going to gain any traction in this
argument. Someone who fetishizes application programming is likely to
remain convinced that UI facilities in the host environment are the
center of the universe, sweet reason notwithstanding.

(Most of *my* ECMAScript work has very little to do with UIs; it's
doing work I actually find interesting, like text processing. And
there the actual language is very relevant, and the DOM and CSS not at
all. But since that's not the "MAIN use" of "Javascript", I suppose it
doesn't count - at least not in the magical fairy world of
"application" programming.)
 
L

lorlarz

lorlarz meinte:


I suppose it's your lacking in German, otherwise you'd have already
found the link. But then... you are incapable to quote properly. Perhaps
this is just over your head.


I didn't need Crockford for *that*.

Gregor

--http://photo.gregorkofler.at::: Landschafts- und Reisefotografiehttp://web.gregorkofler.com ::: meine JS-Spielwiesehttp://www.image2d.com     ::: Bildagentur für den alpinen Raum

Hey, I appreciate Crockford, though could do perfectly ok without him
(though better with him). But, I disagree, the issues of how to
best
programatically interact to change the UI display via the DOM and/or
CSS using the related JavaScript functions IS A BIG TOPIC
AREA ABOUT GOOD PROGRAMMING, looking a a huge groups of JS functions
Crockford is apparently too insecure to address.

If you script kiddies ever tried actually making a PROGRAM with
Javascript
that people could use, you would see this lightning fast.
 
T

Tim Streater

Joost Diepenmaat said:
Heh, I wouldn't use PHP for general scripting :)

Javascript is quite a good as an embedded language, which is what it
is in a browser too. There are a few webservers that support
javascript as a scripting language, which I guess makes sense if
you're already using a lot of javascript at the client - less hassle
converting data back and forth.

Then there's Flash/actionscript - which usually runs in a browser but
has a completely different host object model, and adobe is working
hard at pushing flash/flex/air to the desktop.

OK, thanks. I might disagree with you about PHP but that is getting
quite OT so I won't :)
 
J

Joost Diepenmaat

Michael Wojcik said:
Indeed (and FWIW I agree with you regarding Crockford's book). However:


This is incorrect. The C standard includes the standard library, which
includes stdio. See ISO 9899:1999.

It was my understanding the the standard library is mostly(?) optional
(it's not needed when you're writing an OS in C for example). I can't
find the relevant keywords to google so I may be mistaken about that.

Just the fact that you can replace the standard library probably
counts for something, anyway.
A better example might be that C does not include any support for
GUIs, the great number of GUI programs written in C notwithstanding.

Probably, yes.
That said, I don't think you're going to gain any traction in this
argument. Someone who fetishizes application programming is likely to
remain convinced that UI facilities in the host environment are the
center of the universe, sweet reason notwithstanding.

I think you're right, and I already put this guy in my kill file to
prevent further irritation.
(Most of *my* ECMAScript work has very little to do with UIs; it's
doing work I actually find interesting, like text processing. And
there the actual language is very relevant, and the DOM and CSS not at
all. But since that's not the "MAIN use" of "Javascript", I suppose it
doesn't count - at least not in the magical fairy world of
"application" programming.)

I still have a project on the back burner to write an ecmascript
interpreter in Common Lisp. Probably not relevant either. :)
 
L

Lasse Reichstein Nielsen

Joost Diepenmaat said:
It was my understanding the the standard library is mostly(?) optional
(it's not needed when you're writing an OS in C for example). I can't
find the relevant keywords to google so I may be mistaken about that.

It might be optional, if you don't want to be compliant with the ANSI C
standard :)

/L
 
T

Thomas 'PointedEars' Lahn

Joost said:
It was my understanding the the standard library is mostly(?) optional
(it's not needed when you're writing an OS in C for example). I can't
find the relevant keywords to google so I may be mistaken about that.
Just the fact that you can replace the standard library probably
counts for something, anyway.

Yet I find it hard to imagine to write an efficient OS without libc's stdio.h.


PointedEars
 
J

Joost Diepenmaat

Thomas 'PointedEars' Lahn said:
Yet I find it hard to imagine to write an efficient OS without libc's stdio.h.

The OS might *provide* a stdio.h, but an OS would have to *implement*
it itself (or at least, provide the kernel calls with which stdio.h
would be implemented).

See for instance: fopen(3) vs open(2)

But we're getting very off topic now.
 
L

lorlarz

In comp.lang.javascript message <55ec33dc-ef70-4ef1-a102-5ac18a04d4b4@s5
0g2000hsb.googlegroups.com>, Tue, 19 Aug 2008 07:23:32, lorlarz


Please give URLs for some of your work, so that we may assess its
quality and (maybe) learn from it.

It's a good idea to read the newsgroup c.l.j and its FAQ.  See below.

--
 (c) John Stockton, nr London UK.   [email protected]     IE7 FF2 Op9 Sf3
 FAQ <URL:http://www.jibbering.com/faq/index.html>.
 <URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
 <URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.

If you look earlier in this very thread there are links to my actual
javascript applications -- something apparently almost no one but me
writes.
While mine may not be sophisicated, know that I work completely alone
& at least I
do applications in JS. When are the rest of you going to get with
that program,
and start _and_ thus quit being script kiddies and giving javascript,
the world's
best programming language, a bad name??
 
K

kangax

lorlarz meinte:
[crap snipped]
Just stop reading books, which scope you can't or won't understand.
Resort to Resig's alternatives.

--http://photo.gregorkofler.at:::Landschafts- und Reisefotografiehttp://web.gregorkofler.com ::: meine JS-Spielwiesehttp://www.image2d.com    ::: Bildagentur für den alpinen Raum

Frankly, I just thing you Crockford fanatics are lazy and just want
to
read 100 pages and think you know something.  You could hardly make a
single decent
interactive JS program appear in a browser with what is in that book
(and perhaps
couldn't).  Yet, somehow Crockford claims to cover the "best parts"!
What a joke.

How are you going to
effectively and efficiently change the user interface?  Crcokford does
not
help even the slightest bit here, though this is a major issue (just
perhaps not
one pat enough for crabby Crockford's taste).  About 10 good books
Crockford
shows no respect for are the only sources to learn anything about
this,
including any principles of good coding in this area.  He disrespects
the
hard work of a decade of hard-working book writers -- all people I
read and
learned greatly from (though admittedly many of the books were in some
ways "bad"
and often read like encyclopedias).  But, Crockford's book is bad
because it is so
incomplete and its examples covering only a small subset of the
practical functions
in Javascript.  Really good books show really good programs (at least
some) and they
actually appear in your browser.  Crockford has written just another
very bad book,
from this perspective.   CSS/DOM:  Do the Crockfordians forget is
exists or that
there are many good/bad practices in dealing in this area??

Crockford's book (to be useful) really assumes you know at least many
many
times as much about JavaScript than is in the book.  Crockford's
abstract
examples do not deal with much of the JavaScript a JavaScript
programmer uses.
Places where we need to have principles and best practices clarified.
CSS/DOM

Crockford is good in his small limited area.  I learned from him and I
value
that learning.  But the conceit of Crockford and disparaging other
books, when '
he writes just one that is outrageous limited and incomplete makes me
think he is an
old foggie.

Another VK. *sigh*
 
L

Laurent vilday

lorlarz :
Dr J R Stockton :

ROFLMAO. That's a lie, anyway, who cares ?
If you look earlier in this very thread there are links to my actual
javascript applications -- something apparently almost no one but me
writes.

ROFLMAO bis. Of course nobody else would have wrote such crap. Are you
really serious when you show the group thoses crapy .. hurm... stuff ?

Let's take your first example and get a real good laugh, would you ? You
looking for it since a long time after all. So, well, let me get a bit
nasty with your ugly code, if it can help you shut up.

<http://mynichecomputing.com/ReadIt/translateT.html>
For a start, you DTD is not valid, and even if it was valid, your
document is far away from being a valid HTML 4.01 strict. Real
developper know he *HAS* to correctly validate his document before
trying to add some JavaScript behaviour on it. Especially when they do
JavaScript since 10 years as you claiming. After 10 years of JavaScript
you should know that, and more important you should never have shown
experts (yeah, even if I dislike some here, experts are here) your ugly
stuff.

But let's see the JS, HTML is OT here. And since you doing JS for so
many times, you don't need to be pinpointed to each HTML errors, you
will fix this simple HTML quicky, I have no doubt. Mwarff.

<http://mynichecomputing.com/ReadIt/matchingb.js>

OMG. Nope, finally I will let this awfull crap rot alone in hell. It is
in top position for being one of the worst JavaScript I have seen so
far. Can't be quickly fixed, it needs a rewrite from scratch, but from
someone knowing what he is doing. You don't know.

Anyway, looks like you should use some JSLint goodness. Probably it is
time for you to start learning the "JavaScript Good Parts".
While mine may not be sophisicated, know that I work completely alone
& at least I
do applications in JS. When are the rest of you going to get with
that program,

Don't need to compare anything to your "scripts", you will loose for
sure. My **** is MUCH bigger than yours of course. Blah Blah Blah.
and start _and_ thus quit being script kiddies and giving javascript,
the world's
best programming language, a bad name??

Nice Troll, and you get fed by everyone here. You are trully a good
troll. Congrats.
 
T

Thomas 'PointedEars' Lahn

kangax said:
[...]
Crockford is good in his small limited area. I learned from him and I
value that learning. But the conceit of Crockford and disparaging
other books, when ' he writes just one that is outrageous limited and
incomplete makes me think he is an old foggie.

Another VK. *sigh*

Yes, indeed. Please do not feed the troll. Thanks in advance.


PointedEars
 
L

lorlarz

lorlarz :


ROFLMAO. That's a lie, anyway, who cares ?



ROFLMAO bis. Of course nobody else would have wrote such crap. Are you
really serious when you show the group thoses crapy .. hurm... stuff ?

Let's take your first example and get a real good laugh, would you ? You
looking for it since a long time after all. So, well, let me get a bit
nasty with your ugly code, if it can help you shut up.

<http://mynichecomputing.com/ReadIt/translateT.html>
For a start, you DTD is not valid, and even if it was valid, your
document is far away from being a valid HTML 4.01 strict. Real
developper know he *HAS* to correctly validate his document before
trying to add some JavaScript behaviour on it. Especially when they do
JavaScript since 10 years as you claiming. After 10 years of JavaScript
you should know that, and more important you should never have shown
experts (yeah, even if I dislike some here, experts are here) your ugly
stuff.

But let's see the JS, HTML is OT here. And since you doing JS for so
many times, you don't need to be pinpointed to each HTML errors, you
will fix this simple HTML quicky, I have no doubt. Mwarff.

<http://mynichecomputing.com/ReadIt/matchingb.js>

OMG. Nope, finally I will let this awfull crap rot alone in hell. It is
in top position for being one of the worst JavaScript I have seen so
far. Can't be quickly fixed, it needs a rewrite from scratch, but from
someone knowing what he is doing. You don't know.

Anyway, looks like you should use some JSLint goodness. Probably it is
time for you to start learning the "JavaScript Good Parts".


Don't need to compare anything to your "scripts", you will loose for
sure. My **** is MUCH bigger than yours of course. Blah Blah Blah.


Nice Troll, and you get fed by everyone here. You are trully a good
troll. Congrats.

So I did not put a standard one line at the top of the html. I should
just
copy and paste that line from another of my JS programs, maybe from
my JARS.COM well-reviewed JAVASCRIPT ***PROGRAM****,
http://mynichecomputing.com/GuideInfoandPlanner/UniversalDD.htm
(rated 950 out of 1000 and in the top 5% of jars.com listed JS
programs)

Otherwise, laurent, your critcisms of the script are unclear and
unsubstantiated
(JUST WHINING, WITH NO SPECIFICATION OF ANY PROBLEMS). I think you
are
just full of crap. A pretender, as SO MANY SCRIPT KIDDIES ARE.

Fact is, I do PROGRAMS IN JAVASCRIPT, where a client/user goes
through
several rational steps to get a result, all just in JavaScript AND
where it is a purely javascript program. There are apparently
approximately
ONE programmer in the world who does JAVASCRIPT PROGRAMS.

Let's contemplate a definition:
You have a user working with a JavaScript PROGRAM when they are
doing stuff continuously in Javascript from
start to result with several significant steps along the way -- that
is a
program.

One will NOT fully appreciate the "good parts" of JS and application
of
principles to the use of JavaScript DOM walking and creation and
manipulation
functions _and_ the CSS manipulation JS functions
UNTIL YOU ACTUALLY WRITE PROGRAMS. I SEEM TO BE ABOUT THE ONLY ONE
DOING THIS.

ALL the rest (** Crockford, NOTWITHSTANDING **) is just script kiddie
stuff.
If you want to show credentials, that you are NOT just a script
kiddie,
provide links to your JavaScript PROGRAMS. Otherwise you whiners can
shut the hell up, because you do not know what you are talking
about!!!

You will not know all the "good parts" of JavaScript until you make
JavaScript PROGRAMS for the browsers.

SHOW OR STUFF, WE ALL SHOULD ASSUME YOU ARE A SCRIPT KIDDIE, making
the LEAST
of the great HS language.
 
L

lorlarz

lorlarz :


ROFLMAO. That's a lie, anyway, who cares ?



ROFLMAO bis. Of course nobody else would have wrote such crap. Are you
really serious when you show the group thoses crapy .. hurm... stuff ?

Let's take your first example and get a real good laugh, would you ? You
looking for it since a long time after all. So, well, let me get a bit
nasty with your ugly code, if it can help you shut up.

<http://mynichecomputing.com/ReadIt/translateT.html>
For a start, you DTD is not valid, and even if it was valid, your
document is far away from being a valid HTML 4.01 strict. Real
developper know he *HAS* to correctly validate his document before
trying to add some JavaScript behaviour on it. Especially when they do
JavaScript since 10 years as you claiming. After 10 years of JavaScript
you should know that, and more important you should never have shown
experts (yeah, even if I dislike some here, experts are here) your ugly
stuff.

But let's see the JS, HTML is OT here. And since you doing JS for so
many times, you don't need to be pinpointed to each HTML errors, you
will fix this simple HTML quicky, I have no doubt. Mwarff.

<http://mynichecomputing.com/ReadIt/matchingb.js>

OMG. Nope, finally I will let this awfull crap rot alone in hell. It is
in top position for being one of the worst JavaScript I have seen so
far. Can't be quickly fixed, it needs a rewrite from scratch, but from
someone knowing what he is doing. You don't know.

Anyway, looks like you should use some JSLint goodness. Probably it is
time for you to start learning the "JavaScript Good Parts".


Don't need to compare anything to your "scripts", you will loose for
sure. My **** is MUCH bigger than yours of course. Blah Blah Blah.


Nice Troll, and you get fed by everyone here. You are trully a good
troll. Congrats.

So I did not put a standard one line at the top of the html. I should
just
copy and paste that line from another of my JS programs, maybe from
my JARS.COM well-reviewed JAVASCRIPT ***PROGRAM****,
http://mynichecomputing.com/GuideInfoandPlanner/UniversalDD.htm
(rated 950 out of 1000 and in the top 5% of jars.com listed JS
programs).

Otherwise, laurent, your critcisms of the script are unclear and
unsubstantiated
(JUST WHINING, WITH NO SPECIFICATION OF ANY PROBLEMS). I think you
are
just full of crap. A pretender, as SO MANY SCRIPT KIDDIES ARE.


Fact is, I do PROGRAMS IN JAVASCRIPT, where a client/user goes
through
several rational steps to get a result, all just in JavaScript AND
where it is a purely javascript program. There are apparently
approximately
ONE programmer in the world who does JAVASCRIPT PROGRAMS.


Let's contemplate a definition:
You have a user working with a JavaScript PROGRAM when they are
doing stuff continuously in Javascript from
start to result with several significant steps along the way -- that
is a
program.


One will NOT fully appreciate the "good parts" of JS and application
of
principles to the use of JavaScript DOM walking and creation and
manipulation
functions _and_ the CSS manipulation JS functions (and doing it
all in the best ways) UNTIL YOU ACTUALLY WRITE PROGRAMS.
I SEEM TO BE ABOUT THE ONLY ONE DOING THIS.


ALL the rest (** Crockford, NOTWITHSTANDING **) is just script kiddie
stuff.
If you want to show credentials, that you are NOT just a script
kiddie,
provide links to your JavaScript PROGRAMS. Otherwise you whiners can
shut the hell up, because you do not know what you are talking
about!!!


You will not know all the "good parts" of JavaScript until you make
JavaScript PROGRAMS for the browsers.


SHOW YOUR STUFF, WE ALL SHOULD ASSUME YOU ARE A SCRIPT KIDDIE, making
the LEAST
of the great JavaSript language.

IN FACT:
I have yet to see a PROGRAM in JavaScript from Crockford and if he is
just a script kiddie, he is not qualified to determine "the good
parts"
of the JavaScript language. PERIOD. It matters little how smart he
is or
what he likes. (And if he does not realize this, he is an ass.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top