Subtitles section Play video
Souders: All right, welcome, everyone.
It's great to see a big crowd here.
My name's Steve Souders.
I work here at Google on latency.
And I wanted to do a couple plugs for these talks.
I'm trying to see about starting up a series
of tech speakers coming in.
So a couple weeks ago we had John Resig come in
and you can see that talk
up on the Google developer channel up on Google code.
And next Thursday at 11:00 A.M. right here
is Rob Campbell who works at Mozilla
and he's one of the people leading the Firebug effort.
And he's gonna do a talk next Thursday at 11:00
right here on Firebug and the new releases
that are coming out and some of the new features.
And-- But today--
So today we have Doug Crockford.
Um, I worked with Doug at Yahoo.
That's where I met him.
And I remember the first time I met him
and he told me his name, I said,
"I know that name somewhere. I know that name somewhere.
Oh, yeah, I've been using the stuff on your website a lot."
And so I was really excited to meet him.
And he's a really nice guy.
I enjoyed working with him at Yahoo.
Um, I--
I, uh, have a little bit of hesitation
because when my book came out, it did pretty well.
And then Doug's book came out and just kicked my book's butt.
And so I just checked.
And I'm, like, at 6,000 and you're at, like,
4,000 on Amazon sales rank, Doug.
So that's really good.
And I believe that this talk is largely based on his book,
"JavaScript: The Good Parts."
And so we'll run for about an hour
and have time for Q and A.
So without any further ado,
please help me welcome Doug Crockford.
[applause]
I forgot.
Here's your Google tech talk goodie bag.
Crockford: This is what makes it all worthwhile, right here.
[laughter]
So, thank you, everybody.
I'm Doug Crockford from the Yahoo.
And I'm here today to talk about the good parts.
Now when I first started talking about JavaScript,
there were a lot of people who just could not accept the fact
that JavaScript has good parts.
But, in fact, it does.
But it's not well understood. Even now.
JavaScript has become probably the most important
programming language in the world.
There's more JavaScript processors
on more computers than anything else
by a very large factor.
But despite that, JavaScript is not held
in very good esteem, even within
its own programming community.
For example, the C# community loves Anders.
And the Java community loves Gosling.
And the PHP community loves Rasmus.
But in the JavaScript community, there is no love.
And there should be.
And I think it indicates a lack of understanding.
That's why JavaScript is still the world's
most misunderstood programming language.
It's the only language that I'm aware of
that people feel that they don't need to learn it
before they start using it.
[laughter]
It kinda looks familiar and yeah, yeah, yeah, yeah.
I've seen this before. I know how this works.
In fact, it works in a really radically different way.
It just looks very similar.
And then when people misuse it as inevitably they do
because they don't know how it works,
they get angry at it, and misunderstand it.
Which is a shame because there's actually
good stuff in this language.
And because it's everywhere, JavaScript is now becoming
the virtual machine for the world,
which is a really odd mission for this
little misunderstood language.
You know, you're doing it here at Google with the GUID.
And there are lots of other examples
of the same kinda crazy thing.
You know, it amazes me the lengths that people
will go to to avoid having to learn JavaScript.
But it's learnable and you can actually
write good programs in it.
And like everything else, knowing what you're doing,
you know, makes a difference.
And so I'm here to enlighten the world about JavaScript.
JavaScript is a language of many contrasts.
It contains some of the best ideas ever put
into a programming language.
And it contains some of the worst ideas
ever put into a programming language.
And a lot in between.
There's no other language which has this amazing range
of the ridiculous and the sublime.
Um, if you look at the community of people
who use JavaScript, it has the broadest range
of programmer skills of any programming language.
We've got people at the very high-end doing computer science
in this language, which it does really well
'cause it's basically a scheme with C syntax.
And we've got cut-n-pasters who don't even know
that they're programming, who are putting stuff together
and making it happen.
If you gave those kids Java compilers,
they would never get "Hello World" running,
but they can work with JavaScript.
So the language has amazing expressive power
and it supports everybody in between.
I contend there is no other programming language
that can support this really broad audience of users.
And I'll offer that as further evidence
that this language is getting something right.
Which again, may be surprising to the people who think
this language didn't get anything right.
One of the reasons people think that is that
they have a lot of complaints about it.
And I think these complaints are all valid
and I'd like to go through them one at a time.
The first one is that JavaScript is not a language I know.
If you're programming in any environment--
the desktop or embedded systems or the server--
generally, you get to pick what language you're going to use.
But if you're writing in the browser
or if you're writing in one of the applications
that has embedded JavaScript in it,
you don't get a choice.
You have to use JavaScript.
And a lot of people get resentful about that.
You know, "Why should I have to learn this stupid language?
"I already know lots of other good languages.
Why can't I use one of those?"
You can't.
Um, and so they...
try to write without learning the language,
which I think is really a bad thing to do.
My advice is man up and learn the language.
If you need to be writing in JavaScript,
there's nothing like knowing what you're doing.
Second complaint.
The browser programming experience is awful,
which is absolutely true.
But that's not JavaScript's fault.
I contend it's the DOM's fault.
The DOM is one of the worst APIs ever imagined
and that's what you have to use when you're using the browser.
Fortunately, there are a lot of Ajax libraries available now
which all do an amazing job at correcting the DOM model
and turning it into something that you can actually
write good applications in.
So, uh, there is a solution to that.
I'm hoping eventually we can push that solution
back into the browser.
But for now, the Ajax libraries work really well.
YEY, I'll mention that one. Comes out of Yahoo.
It's actually very, very good.
I think maybe the best of them.
There are lots of others that are also very good.
There's a complaint that it's not fast enough.
And in the browser, that's mainly because of the DOM again.
If you look at the fraction of time
that your program spends running,
a tiny fraction of that is actually running
in the JavaScript interpreter.
Most of the rest of it is wasting time
in the DOM interface.