Google I/O 2011: JavaScript Programming in the Large with Closure Tools

preview_player
Показать описание
Michael Bolin

Most developers who have tinkered with JavaScript could not imagine writing 1,000 lines of code in such a language, let alone 100,000. Yet that is exactly what Google engineers have done using a suite of JavaScript tools named "Closure" to produce many of the most popular and sophisticated applications on the Web, such as Gmail and Google Maps.
Рекомендации по теме
Комментарии
Автор

very nice, michael. I did appreciate the subtle NES references...

noli-timere-crede-tantum
Автор

Looking forward to work in a project using closure library. Pretty impressed by its advanced mode compiler and the way it minifies the code.

SamarPanda
Автор

From the python wiki: "Python is strongly typed as the interpreter keeps track of all variables types."

Since every programming language I use (including Javascript) does this, then by this logic EVERY programming language is strongly typed.

Definitions are important, don't you think?

TheMonk
Автор

Really useful video for javascript closure newbie.

lail
Автор

The Triforce - Great Zelda reference!! And great presenter!

methodinsane
Автор

Depends on your definition. Saying that Python is strongly-typed because it doesn't allow operations that some 'weakly-typed' languages do isn't really enough.

For most, 'strongly-typed' is virtually equivalent to 'statically-typed' in most usages. A strongly-typed language SHOULD allow specification of parameter types for functions, which reduces the code required to validate parameters.

Can Python do that? No? Not strongly typed enough then.

TheMonk
Автор

I would actually like my code to NOT be obfuscated or illegible (up yours, "intellectual property"), so I guess I'll just not use parts of the compiler? Is that easy enough?

PangeaMinor
Автор

And this is not a issue in javascript, seeing the history of Javascript.

xzaz
Автор

Using the classification for a large application (2:30) I would put the one I'm working on as medium.
~10, 000 LOC ( so far )
1 Person
3 months ( so far )

Hector-bjls
Автор

And C# doesn't satisfy YOUR definition either:

string.Join(", ", new int[] { 1, 2, 3 }) == "1, 2, 3"

Implicit type conversion or type promotion does not mean a language IS NOT strongly typed, any more than explicit denial of specific operations DOES mean that a language IS strongly typed.

So cherry-picking specific definitions to say 'Language X is strongly typed' is not sufficient.

TheMonk
Автор

In javascript

"" == 0
true

This is not strongly typed

"5" + 4
54

This isn't either.

You can't do this type of stuff in Python, that's what makes it strongly-typed.

Wikipedia defines strongly typed as : "a type system is said to feature strong typing when it specifies one or more restrictions on how operations involving values of different data types can be intermixed. The opposite of strong typing is weak typing." You're free to change the definition if you're not happy with it

HardShooter
Автор

"there's no good way to ensure that calculations involving people's money comes out right."

How about that?
money*=100;
/* making calculations */
money/=100;

knny
Автор

Once again you are free to remove Python from the example list, and change it's wikipedia page

HardShooter
Автор

It does scare me, but not anymore with Javascript :) Does it make it good? No, does it makes it wrong? I don't know..

xzaz
Автор

Javascript exists only because it was capable of opening popups faster than Java.

lennyhome
Автор

Great, I'm seeking those things for my awesome project >.<

redstrikedn
Автор

Nice - and blatant - quote mining. Just as valid as my sarcastic response.

Of course it's not that simple... it seldom is. Restricting operations on disparate types already happens in Javascript, just at a level that doesn't apparently satisfy your threshold.

Now go look at "strong typing" in Wikipedia. Does Python satisfy all of the definitions given there? No, it doesn't.

Given a narrow enough focus you can justify many things. But broaden the scope and Python is NOT strongly typed.

TheMonk
Автор

Not really convinced. The pitch was excellent, but the practice, the development cycle, seems as if it would be a pain in the ass.

batbawls
Автор

BTW Java doesn't satisfy all of the definitions

HardShooter
Автор

@ 07:10 People find it annoying because "things" like internet explorer. HAHAH!

adamghanem