
JavaScript at 20 - kolodny
http://brendaneich.github.io/ModernWeb.tw-2015/
======
iyn
If you're interested in learning ES6 basics in 20 minutes, this is a great
starting point:
[https://github.com/lukehoban/es6features](https://github.com/lukehoban/es6features)

Check out this repo, if you have a "little more" free time:
[https://github.com/ericdouglas/ES6-Learning](https://github.com/ericdouglas/ES6-Learning)

To be honest, I used to dislike JS not so long ago - it was hard to debug, I
had to use strange conventions to write OO code etc. But after learning more
about the ES6, react/flux, node, Flow etc. I can honestly say that I really,
really like JS. I think that I had negative feelings towards JS because I was
using it "the old way" and completely ignored the language improvements &
community/ecosystem that grew aroud it. But I learned my lesson :).

~~~
stickperson
What other resources did you use? I'm slowly working my way though Programming
JavaScript Applications.

~~~
iyn
There is no a single site/book I use, I just search for a topic that I think
is interesting. Fore example, lately I've been exploring Promises and
asynchronous JS [0][1]. For understanding react & flux, you can watch 3-part
series from SeattleJS [2]. This post is a good general roadmap: [3].

[0] [https://www.promisejs.org](https://www.promisejs.org)

[1] [https://promisesaplus.com/](https://promisesaplus.com/)

[2]
[https://www.youtube.com/watch?v=Pd6Ub7Ju2RM](https://www.youtube.com/watch?v=Pd6Ub7Ju2RM)

[3] [https://medium.com/javascript-scene/learn-
javascript-b631a4a...](https://medium.com/javascript-scene/learn-
javascript-b631a4af11f2)

------
knightofmars
"Haters gonna hate." Anyone claiming that JS is the "worst thing to happen to
the web" and/or that some other language would miraculously solve all of the
problems present in JS should do the following, "Go create it." Don't whine
about the barriers and how a new language would never be adopted because "JS
is already everywhere." There are plenty of people already trying to solve
this problem by actively doing something. I've worked with enough engineers
that love to criticize every design choice made but when it comes to asking
them what the better alternative is they have nothing to say. They just "know"
there's a better way. Well, stop using your intuition based rationalizing that
there's a problem and start using your creative and logical faculties to
actually solve the "perceived" problem before presenting a criticism. Or at a
minimum present a well thought out and actionable direction towards the
solution.

~~~
teacup50
There are no end of alternatives out there today, from mobile platforms to
research languages exploring a myriad of aspects of computer science.

Just let me know when browser vendors are going to break down the two-tiered
system, and let us run the legion of alternatives alongside -- instead of
under -- JavaScript.

Or, they could take their own medicine, and try and write the browser in JS.

~~~
pcwalton
> Just let me know when browser vendors are going to break down the two-tiered
> system, and let us run those myriad of alternatives alongside -- instead of
> under -- JavaScript.

The complexity of doing that would be needlessly high compared to just
improving JavaScript. Having to integrate a C++ DOM with a JS DOM is hard
enough. Think about how you handle cross-language cycles…

> Or, they could take their own medicine, and try and write the browser in JS.

You mean like Firefox?

~~~
mattmanser
Works on OSes. We have a choice.

In browsers, the OSes of the web, nope, just a bad language designed in 10
days that resists all attempts to make it not bad.

It doesn't really matter if you like javascript, there's so many people who
don't.

Why do you get to dictate whether we can or can't develop on the web? You
leave us with a horrible choice, use what we consider to be one of the worst
modern languages, or not develop. Why do you get to make our professional
lives miserable?

~~~
pcwalton
> Works on OSes. We have a choice.

The kernel doesn't have a DOM. On the Web, the number of GC'd objects that
every "process" has to deal with exceeds the number of file descriptors by an
order of magnitude.

Also, you do have a choice: you can compile your favorite language to JS, even
low-level ones via asm.js.

> Why do you get to dictate whether we can or can't develop on the web? You
> leave us with a horrible choice, use what we consider to be one of the worst
> modern languages, or not develop. Why do you get to make our professional
> lives miserable?

That's not the choice: you can compile your favorite language to JavaScript.
That's what source maps, asm.js, and the like are for. And JS is being
improved all the time; it's not static.

Trying to add another language has been tried multiple times and has always
failed, because having two languages that both interact with the DOM is much
more difficult than just improving JS.

~~~
ForHackernews
Semi-serious question: Other than backwards compatibility, do browsers need to
have a DOM? It seems like many web app devs spend more time fighting against
the DOM than working with it. Why not just make the browser expose a generic
GUI model? Let web devs interact with Webkit or QT directly?

~~~
nostrademons
Generic GUI toolkits are very often _worse_ than the DOM. I've worked with
Swing, MFC, SWT, Android, and iOS, and all of them are significantly more
complicated than the DOM is. They do function at a higher level of
abstraction, and the two really nice things they give you are components and a
sane layout system (solved by WebComponents and Flexbox, now if only all the
major browser vendors would just adopt WebComponents...), but in general I've
found that iOS development is about 1.5x-2x slower than web development and
native Android development is about 3x slower, roughly on par with Swing or
SWT. MFC was a clusterfuck, I wouldn't even go there.

The way frontend devs for other platforms deal with it is to specialize in the
nuances of the platform and effectively build your app around the capabilities
that Google/Apple/Microsoft/Sun provide. That's fine, and makes for a fairly
uniform, polished experience if you have good devs, but it significantly
restricts the set of apps you can build. The reason web developers like
developing for the web is because it doesn't make you a sharecropper in
Google/Apple/Microsoft's world, while building a full-featured GUI framework
into the browser would.

~~~
wbillingsley
I've found JavaFX's scenegraph approach rather neat. Effectively it borrows
from HTML, but where the basic node set is designed to be UI elements rather
than co-opting a set that was designed for text documents. It seems to take a
surprisingly small amount of code to sketch up an interface.

React's not bad on the web side (especially with Scala.js) but fudging around
layouts in components with divs and Bootstrap still feels clunky.

------
codewithcheese
I have learnt that if I click a javascript post and see a title and author
slash screen and nothing else apparently I must start using my right arrow
button.

~~~
snarfy
I have to admit I kind of despise these 'slideshow pages'. They needlessly
break the web for a gimmick.

~~~
tracker1
Some have the visual Arrows in a corner, which makes it easier to
distinguish...

------
mitchi
If you haven't seen a Brendan presentation, they are quite enjoyable. Last
time he was playing some zombie video game in the middle of his presentation.
He insisted on not killing zombies with a shovel using instead deployable
automatic turrets. I'm sure he uses the shovel when he plays alone though.
Javascript's is actually growing very well and fast. It's quite surprising how
soon it will have everything. In a way it can be compared to PHP - soon it
will be a giant toolbox. The difference is that every tool was chosen and
added one at a time. It ends up being a very good toolbox. I'm sure productive
programmers aren't complaining. Pure FP programmers can always compile their
ClojureScript to Javascript. For me, ES7 Javascript is already making me
happy.

~~~
tracker1
Honestly, I love JS... ES7's async/await is really nice too. But I wouldn't
compare it to PHP (which I personally dislike) at all.

------
arenaninja
So good to see String.prototype.startsWith and String.prototype.endsWith in
ES6. I've ended up implementing these in too many projects. I look forward to
using these in 2020 or 5 years after that, when IE 8 finally sunsets. (I joke
of course, since you can use ES6 to 5 with IE 8 caveats with the modern
taskrunners).

EDIT: Blockscope... what? More than a few of these changes point to JS being a
functional version of PHP, but doesn't blockscope just fundamentally change
the language?

~~~
albemuth
It's just for "let" AFAICT.

~~~
BrendanEich
Only for let, const, class, and function in block. Like the slide says!

------
BurningFrog
"Date hand-ported (h/t ksmith@netscape.com) from java.util.Date"

I knew it!!

The Date class is/was the worst thing about the Java library. It has confused
a generation of programmers about dates and time zones.

The main problem is that it's not a date, it's a time stamp.

~~~
tosh
For examples how a neat DateTime API can look like you might want to check out
Dart's DateTime from the standard library:

[https://api.dartlang.org/apidocs/channels/stable/dartdoc-
vie...](https://api.dartlang.org/apidocs/channels/stable/dartdoc-
viewer/dart:core.DateTime)

or

how Java 8 finally fixed DateTime inspired by Joda Time
([http://www.joda.org/joda-time/](http://www.joda.org/joda-time/)):
[http://www.oracle.com/technetwork/articles/java/jf14-date-
ti...](http://www.oracle.com/technetwork/articles/java/jf14-date-
time-2125367.html)

~~~
BurningFrog
Yeah, when Joda arrived, my Java programming life quality really improved.

------
M8
I just wish the best language would win, not the accidentally ubiquitous one.
And giving a real choice of language would been even better.

~~~
jessaustin
Well, at least Java didn't win. Those not old enough to remember "applets" may
not know how lucky they are. Eich deserves credit for all sorts of things, but
not least for saving us from that. And who knows what scripting languages the
browsers of tomorrow might support?

~~~
robocat
Even worse: imagine a world with VBScript instead of ECMAScript...

------
bla2
Every single presentation of Brendan has this "I made this in 10 days" thing,
super annoying. JavaScript is a great example how your career can go pretty
well if you're good at selling what you're building, even if it's not very
good.

This isn't meant as a "JavaScript sucks" type of comment, but as a "being good
at presenting your work is really important" type of comment. Too many really
strong engineers aren't good at selling their work, so we end up with
JavaScript.

~~~
anilgulecha
I think he includes it as a joke .. clearly the first few slide states started
"in 1993" and done "in 1995". The 10 days seems to be a self-deprecating joke
on the popular (incorrect) meme.

~~~
BrendanEich
No, I did original JS ("Mocha") in ten days.

The joke in those slides was how I went from my before-Netscape health (the
picture of me doing a back handspring was from 1993; I joined Netscape in
April 1995) to the after-those-ten-days-in-May-1995 state (looking like Ash
from Evil Dead 3, with chainsaw for hand).

From 1992 to 1995 I worked for MicroUnity. No JavaScript there! It was not
even a gleam in my eye, although I did write a language processor for editing
MPEG-2 streams.

So I indeed created JS in a mad rush to get it into Netscape 2, along with
other things Netscape tried as part of a platform play against Microsoft.

If I had not rushed, I would have missed not only Netscape 2, but also
Netscape 3. Netscape 3 was supposed to be version 2.1, a minor release, until
a company Netscape had acquired was given the browser and screwed up their
release schedule so badly that it slipped into 1997 and became Netscape 4.

In 1998 or even 1997 it would have been too late to ship JS and have it make a
de-facto standard. MS had already shipped VBScript as a me-too, and if they
did not have JS to imitate, it would have been even more Microsoftian.

VBScript was the alternative to the JS rush job, in my settled view. I don't
write this out of pride, joy, or defensiveness. I simply think it's the
likeliest alternative outcome.

(Updated to correct Netscape 4 date per
[http://en.wikipedia.org/wiki/Netscape_Communicator](http://en.wikipedia.org/wiki/Netscape_Communicator)
to June 1997. It was so buggy that a series of firedrill releases were
required to get it into barely usable shape by '98, which is what burned that
year into my memory.)

~~~
dkopi
Wanted - Fullstack VBScript developers You have: Delivered a fully functioning
single page application Using Vanilla VBS. Delivered high performance backends
with ASP(using VBScript) Advantage - you've used Angular.vbs and Backbone.vbs,
and are familiar with react.vbs

Talk about dystopian alternative universes.

------
Torgo
I find it very interesting that he says asm.js was "discovered" rather than
"invented". Clues to a person's philosophy.

~~~
azakai
I think that's similar to how people say JSON was discovered by Crockford.
Both only use things already present in the language, but they do form
something new out of them. It is sort of a middle ground between discovery and
invention.

~~~
TazeTSchnitzel
Moreover, asm.js effectively already existed, right? It's not _quite_ the
same, but it's essentially a formalisation of what emscripten and the like
already produced.

~~~
Torgo
Is there anything written that explains this? I sort of got that impression
when he talked about how JS was untyped but the js bytecode vm had types.

~~~
azakai
Modern JS VMs have type-specializing JITs. That's how they make code run fast,
basically - they detect types at runtime, and emit efficient code for that.

asm.js just gives them the types, which makes things easier, but it all builds
upon the existing power of JS VMs. See e.g.
[http://kripken.github.io/mloc_emscripten_talk/sotu.html#/16](http://kripken.github.io/mloc_emscripten_talk/sotu.html#/16)

------
cageface
This is the first time a webpage has ever triggered a reboot on my iPad.
Ironic.

~~~
Raphmedia
It's his raw presentation file made public and not really a webpage meant for
the world wide web.

------
jongdubois
Overall, JavaScript is a great language. I don't find the prototype-based
approach to OOP any less intuitive than the class-based approach. I much
prefer it in fact.

It just so happens that the prototype approach didn't catch on early enough.
Developers are now just really set in their ways and are rather pretend that
JavaScript is not a true OO language.

I feel that the addition of a 'class' concept to ES6 adds no value to the
language itself, but I think it was probably a good decision anyway - Because
JavaScript is more flexible and adaptable than the minds of most people - It
might as well use that to its advantage.

Unlike the stubborn developers who refuse to learn about prototype
inheritance, JavaScript is capable of change.

------
vxNsr
Nice presentation but some of those slides are useless without notes or audio
to explain what's going on. I like looking at code snippets as much as the
next guy but without context I'd much rather admire my own code.

------
robert_tweed
This page caused my iPad to hard reset. Twice.

That's pretty impressive actually, but I don't currently have access to any
other computers to read it on, so it's also quite bothersome.

Does anyone have an alternative URL with the content, but without the
slideshow or whatever it is? I'm presuming it's some JavaScript that is
causing the crash.

Yes, I appreciate the irony and no, I'm not trolling. I really want to read
this!

------
copsarebastards
JavaScript at 20... apparently doesn't work. I load the page and get a big
rectangle that says "JavaScript at 20" and "Brendan Eich" with a link to his
Twitter, and nothing I do on the page takes me to the rest of the
presentation.

~~~
codewithcheese
Its insane but press the right arrow button.

~~~
imron
Came here looking for this. Insane.

------
pfooti
This is a fascinating meta-post. First, it's a slideshow, so there need to be
some posts about right arrows and general complaints about scrolling (as if
Eich created this content himself to post to HN, instead of to be a speaker
aid for himself). Second, it's about Javascript, so a bunch of people who
really love lambda syntax and significant whitespace are going to show up and
talk about how much better the web would be if we all ran python in the
browser.

I think the web would be a lot better if we just ran lisp in the browser.
Heck, I think lisp is pretty much the answer to all our problems. But nobody
ever asked me.

As someone who was developing for the web in the (late) 90s, using web
browsers and java as a cross-platform UI for educational software (mac and
windows!) who tried to get java applets to communicate with each other
(possible but difficult, and I ended up running a local java application that
the applets RPCd to), I can say this with distinct clarity: the DOM and
current (modern ES6) javascript system are pretty great. Sure, they could be
better in some ways, but I don't trust Joe Programmer (just for example here)
to understand re-entrant code well enough to write stuff that actually works
in a multi-threaded environment, so single-thread event-driven is great.

People complain about this binding and so forth, but it provides a great
borrowing / mixin mechanism to the language that is just flat out impossible
in other languages. The prototype inheritance system is funky, but es6 classes
mean you don't need to worry about it. If you want to, you can do some pretty
rad metaprogramming with it, though.

Type coercion is kind of a pain, and frankly I'd love to be able to override
operators (writing === semantics for objects over and over is kind of a PITA).
But seriously, Javascript is pretty great. I pass around functions, chain
together stuff with functional-based approaches (front-to-back no less), and
can do all sorts of hip kinds of programming with it.

Maybe if we had some truly-different language driving the web, things'd be
different, but don't complain about javascript and just put forward python.
Put something like haskell or smalltalk on the block. Let's go big with the
radical differences. I mean, c-ish languages are c-ish languages. I only wish
CSS was as nice as Javascript. If I had my druthers, that's where we'd be
focusing; that and namespaces within the DOM (hello, shadow DOM!)

Okay, longpost over. And late no less - serves me right for working all day
instead of reading HN. Writing JS no less.

------
izolate
JavaScript is like English. It incorporates the best parts of other languages.
Starting from Java, you can now see the clear influence of Python in ES6/7
with generators and string templates. I think this is JS's greatest asset.

~~~
TazeTSchnitzel
I wouldn't say English "incorporates the best parts of other languages", but
you're on the right path. Like English, JavaScript's ubiquity has lead to it
being elaborated such that it is suitable for a very wide range of use cases.
Like English, JavaScript's ubiquity has made the language grow considerably,
but it has made the language more flexible at the same time.

------
drawkbox
Interesting the Date object was a direct port from java.util.Date. It always
felt a little out of place in terms of style in early javascript and this is
why.

ES6 is awesome and there are so many good things happening in it. I was always
a little irked that ES4 (ActionScript 3 was built on it) that had some of
these elements was nixed for ES5 like typing, extending and cleaner events.

Great overview and I picked up a few things I have missed in js advancements
like string handling changes (startsWith, endsWith, trim), templating with `,
multiline strings!, extend, math functions, arrow, default/rest params,
octal/binary literals and tons more. Many of these are probably in everyone's
js libs but nice to have them standard.

I am most excited for asm.js of all due to the WebGL and gaming/app
performance impact that will make when fully integrated in all browsers this
year. asm.js and WebGL gaming is already giving benefit to performance in
Javscript and added typed arrays to ES6.

Also in his 90's TV pic, how could you forget Seinfeld?

------
outworlder
Oh yeah, great, many new features.

But could you please fix the damn boolean logic? And while at it, get rid of
most implicit conversions.

Or forget all those features and bake in a macro system, so that we can fix
anything without having to wait for the next ES[N] standard to get adopted.

~~~
cozuya
Deprecating == is probably a good step. Or better yet just turning == into ===
and removing that. That would cause some chaos thats for sure...

~~~
UnoriginalGuy
They don't have to remove anything, just repeat what they did with "use
strict" but make it, uhh, even stricter. Just a subset of JS which is only the
good parts.

Actually "use strict" actually makes JS an almost good language as mistakes
are immediately flagged rather than "working anyway." But strict mode doesn't
go nearly far enough in my opinion.

I will say for backwards compatibility you're always going to have to write
"===" the only thing a flag would do is break "==" on purpose.

~~~
sjrd
It seems "use strong" is for you.
[https://developers.google.com/v8/experiments](https://developers.google.com/v8/experiments)

------
iwwr
Do you have a video of the presentation?

------
teacup50
"Always bet on JS" is complete nonsense:
[http://brendaneich.github.io/ModernWeb.tw-2015/#74](http://brendaneich.github.io/ModernWeb.tw-2015/#74)

It does those things _poorly_ , and at great expense.

Eich did one thing, in 10 days, that was market positioned such that it became
ubiquitous, and he's been banging that drum ever since -- to everyone's
detriment, given how much power over technical direction he wielded at
Mozilla, and how much impact Mozilla had on the web pre-Chrome.

~~~
pcwalton
"Always bet on JS" is short for "There have been dozens of challengers to
JavaScript over the last 20 years, and they have all failed to gain traction".
What part of that statement is incorrect?

~~~
teacup50
That's not what he's actually saying there; that's a list of technical bullet
points, not market adoption.

However, even if we talk about market adoption; how is Firefox OS holding up
against iOS, Android, and Windows?

> _What part of that statement is incorrect?_

"Always bet on JS" from Brendan Eich really meant, for 16 years, starting in
1998 and during the time that Firefox was most influential over the future of
the web: "I'm never going to bet on anything other than JS".

It's a uselessly self-fulfilling declaration when its stated by a (now former)
browser vendor executive.

~~~
pcwalton
> That's not what he's actually saying there; that's a list of technical
> bullet points, not market adoption.

The point is that if JS couldn't do these things, it would be eclipsed by a
competitor. It instead grew the ability to do those things, and its
competitors never gained widespread adoption.

> However, even if we talk about market adoption; how is Firefox OS holding up
> against iOS, Android, and Windows?

In terms of _languages on the Web_ , JavaScript has always won. It's clear at
this point that the Web isn't going anywhere, even though mobile apps are
important.

~~~
teacup50
> _The point is that if JS couldn 't do these things, it would be eclipsed by
> a competitor. It instead grew the ability to do those things, and its
> competitors never gained widespread adoption._

 _REALLY_?? JS can't do concurrency by any objective performance measure
against systems providing shared state concurrency; how is a competitor going
to eclipse it when the lowest-level syscall interface available to target _is_
JavaScript?

> _In terms of languages on the Web, JavaScript has always won. It 's clear at
> this point that the Web isn't going anywhere, even though mobile apps are
> important._

It ought to be indicative of something that the web is faltering in market
segments where programming languages do more than move DOM elements around.

~~~
pcwalton
> REALLY?? JS can't do concurrency by any objective performance measure
> against systems providing shared state concurrency

[https://blog.mozilla.org/javascript/2015/02/26/the-path-
to-p...](https://blog.mozilla.org/javascript/2015/02/26/the-path-to-parallel-
javascript/)

------
Rainymood
Interesting, really interesting stuff, but for the love of god - PLEASE - just
me use my mouse and scroll! (!!)

~~~
theandrewbailey
Ironically, if you turn off javascript, you can scroll right on through.

~~~
CrystalGamma
So that's why I didn't notice any of that ...

------
Dirlewanger
Cool presentation, but holy shit, taking ~2 minutes to load on FF and freezing
the browser is not.

~~~
carsongross
In fairness, taking 2 minutes to load and freezing the browser is a pretty
darned good summary of Javascript at 20.

~~~
talmand
In fairness, taking 2 minutes to load and freezing the browser is a pretty
good indicator of bad Javascript code.

~~~
BrendanEich
Rather blame FF or some add-on, if you have to guess.

Mark Dalgleish's bespoke framework is tiny. The images are not, so maybe blame
your ISP? Dunno, not guessing, but JS is last on the blame-guess list.

~~~
talmand
Don't get me wrong. I agree wholeheartedly.

I'm just responding to the accusation as if Javascript is the known culprit.
In those cases, chances are the code itself is the problem and not the
language. I can code a page that will likely hang the browser but that doesn't
mean I don't take the responsibility of the code that I wrote.

------
tambourine_man
I'm really curious to read this, but after crashing mobile safari more than 20
times, I've given up.

Edit: _It seems to be Safari 's fault, as Chrome handled it nicely._

------
sker
I never understood why HN likes slideshows so much. Am I the only one who
finds them completely, 100% useless without the audio of the presentation?

~~~
wil421
I didnt even realize it was a slideshow. No arrows or icons you can click to
go to the next/previous slide and nothing on the website saying its a
slideshow.

Thanks for your comment. After I read it I went back and clicked an arrow key
and the cubeshow started.

~~~
cgag
Arrow keys just scroll around for me, I can't see any slides but the first.

Thanks javascript.

------
wppick
Can someone explain the isNaN part of this slide:
[http://brendaneich.github.io/ModernWeb.tw-2015/#46](http://brendaneich.github.io/ModernWeb.tw-2015/#46)

I would expect isNaN("LOL") to be true. Why does he put "true?!", and why does
Number.isNaN("LOL") evaluate to false?

~~~
TazeTSchnitzel
I think I can. The old isNaN() coerces to Number, and non-numeric strings
become NaN in JS, e.g. +"LOL" is NaN. However, the new isNaN() just returns
false if the value passed isn't of the type Number, which I guess might be
useful if you're going to use isNaN() on non-Number values?

Before someone says that NaN means "not a number", technically yes it does,
but it is really just a special value of the Number type.

Edit: Oh, zastavka's comment has enlightened me now. I think the reason they
changed it is because now it'll check if it's NaN (return true) or anything
else (return false), so it'd be like === NaN if you were able to do that.
Previously it'd check if it _coerces_ to NaN. I guess the new behaviour is
more intuitive.

~~~
magicalist
note that isNaN() will remain as it is today, coercing to a number (and so
isNaN('LOL') will continue to return true). Number.isNaN() will have the new
behavior, testing for actual IEEE 754 NaN values (and so returning false for
Number.isNaN('LOL')). Such is the unfortunate price of backwards
compatibility.

------
eldude
WRT async/await, don't lazily prefer serial await, when parallel await is
possible:

Serial example:

    
    
        async function someAsync(list) {
          let ret = [];
          try {
            for (let item of list) {
              let res = await asyncFn(item)
              ret.push(res)
            }
          } catch(e) { /* ignore */ }
          return ret;
        }
    
    

Parallel example:

    
    
        async function someAsync(list) {
          let promises = [];
          try {
            for (let item of list) {
              let promise = asyncFn(item)
              promises.push(promise)
            }
            return await Promise.all(promises)
          } catch(e) { /* ignore */ }
          return [];
        }

------
jessaustin
Sort of off-topic, but I have to observe that slides 58 and 59 are the
clearest, most succinct description of how classes and prototypes are related
that I've seen.

------
LittleDan
For background on the user-defined operators and literals idea for ES7, see
this: [http://www.slideshare.net/BrendanEich/value-
objects](http://www.slideshare.net/BrendanEich/value-objects) (it took me a
little while to find; it hasn't been as prominent in recent discussions as the
other items). I'm excited to see all the progress Javascript is making!

------
vbezhenar
I wonder whether `let` should be used everywhere now making `var` effectively
obsolete? Mixing both declaration styles looks bad.

~~~
svachalek
As I understand it, yes, 'var' is now obsolete. 'let' does the same thing with
less confusing semantics.

~~~
e12e
So, 20+ years ago, javascript was a scheme(-like langauge) -- but was
disguised as java for marketing -- now we can go back to a more scheme-like
javascript?

I wonder if we'd be better off with a proper scheme in the browser in the
first place...

~~~
albemuth
ClojureScript is pretty cool!

------
blakecaldwell
Took me a moment to realize I had to use arrows. I tried scrolling, and
figured maybe the JS on the page was busted.

------
frik
Edit2: When do you switch off your transpiler and serve native ES6? In 2020?

Original:

What do you do in 2017? What if you already code in ES6 and transpile it to
JS5 at the moment. Do you simply switch from serving JS5 to JS6?

Older browsers (todays current browser) don't support "class", "let" and other
new syntax constructs. The just fail with JS errors. Can one browse the web
with IE11 and iOS 8 Safari in 2017? (e.g. "lifetime support" of the device)

Polyfills can be used for pre-JS5 browsers. But can you polyfill "let" and
"class" syntax keyword? One can today still browse the web with IE6 and
Phoenix 0.l (early Firefox), despite a few glitches and layout bugs. Many
sites use polyfills like JQuery and still use JS3 functionality made popular
by Crockford "JavaScript the Good Parts". JS5 added a few things that JQuery
made popular.

The syntax changes between previous JS versions were smaller in comparison to
ES4 and ES6 (ES4/E4X failed and was abandoned).

Edit1: I added "What if you already code in ES6 and transpile it to JS5 at the
moment." as the second sentence to make it clearer. As several down voters
misunderstood my serious question.

~~~
magicalist
The web is a lot more broken if you browse in IE6 than you appear to think.
Some major sites work OK only because they had a financial interest (single
digits of IE6 marketshare) until the last few years to maintain IE6
compatibility. This will degrade rapidly, but go off the very-well beaten path
today and you'll find the web basically unusable.

Backwards compatibility on the web has long been backwards compatibility of
source. Sites written in the IE6 era and not touched since should continue to
work in browsers of today (which is why things like vendor-prefixed features
proved to be a poor idea and are mostly no longer created). You'll get some
rendering oddities, but this is still very much true.

~~~
frik
IE11 (Win8) and various devices that won't receive an update like many Android
4 and older iOS devices will be around for a few years!

Sure, you can use a transpiler and serve JS5 the next ten years (2025). What
do you plant to do? It seems most simply haven't thought about the problems
lying ahead.

Many were against the ES4/E4X changes that e.g. Firefox supported for some
time, as they would have broken backwards compatibility. ES6 breaks backwards
compatibility with the new syntax keywords and there is no fallback afaik. If
there is a fallback, well then everything would be fine.

Wouldn't it be better if such vendors would ship an security & ES6 syntax
support update to their old browser software?

~~~
magicalist
No, people have been against breaking compatibility with old source, like
changing how certain statements are parsed and executed that would have made
old code now in error. This is why strict mode is opt-in and larger ES4-like
changes are dead in the water without careful design.

On the other side of things, though, new features that break in old browsers
are added all the time. Try and run Date.now or Function.bind in old browsers
and they'll immediately throw an error. It's only through polyfilling (and in
some cases transpiling) that sites work in even IE8 today, and it will be the
same situation in the future if a site wants to still work on an old Android
or iOS device.

But yes, staying up to date as a user does depend on a newish browser being
available for the platform you're running, and it would be great if old
devices could continue to get updates. Really old iOS is out of luck, but
Firefox supports back to Android 2.3, so users stuck there can download that
browser to continue browsing the web.

------
alkonaut
Just imagine what the web would be today if only 3-4 weeks had been spent
designing javascript...

~~~
rwallace
Intuitively that makes sense until you reflect that plenty of much worse
languages than JavaScript took months or years to design.

Honestly, much as it's a pastime to grumble about the flaws of whatever
language we find ourselves using, I suspect if you could rerun history a
hundred times, not more than ten of the reruns would give us a better outcome
than JavaScript.

------
eliotfowler
Eich states that in the original implementation of JS, Array was just Object
with a length property. How did it handle order?

~~~
serve_yay
In JS, arrays are just objects where the indices are keys. There is a small
bit of magic where any time you alter an array object, the length is changed
to the largest numeric key the object has, plus 1.

------
manish_gill
> "Always bet on JS"

Yeah, that's why it took you so long to get basic things in the language. The
JS crowd is finally excited that they have these nice shiny things. Quite a
few of those have been a standard part of numerous languages for so long.

"Always bet on JS" basically means this: "JS is too big, so all the fuck ups I
and others made will eventually be fixed. Because nobody is going to try to
bet on anything other than JS now."

It's circular, Eich.

~~~
BrendanEich
Joke's not funny when you explain it.

~~~
BrendanEich
Ok, I guess I have to explain it. (Kids these days!)

I close with a slide containing bullet points rebutting all the dumb things
said about how JS-can't-do-X, not to say how great JS is, but to show that
software is hackable, and if Java, or Flash, or Dart can do X, so can JS.
Evolving JS or doing something else is a matter of choice. JS's priority of
place is not, it happened and it makes JS very hard to replace. But not hard
to evolve.

I use a pic from one of Wesley Snipes's lesser movies, "Passenger 57", where
the bad guy gets TOLD in a macho-funny scene on a plane, over an in-plane
phone yet: "Always bet on black!" It has a great build-up with camera-work and
music to match the delivery. But it doesn't mean anything more or less than
always bet on Wesley kicking that pale-eyed, blond-haired villain's ass,
because Wesley is a bad-ass and way more fit than Bruce Payne (who played the
villain).

JS is way more fit than the comers whose fans spewed all those bogus
detractions. Deal with it.

~~~
backspaces
Turing Complete is soooo comfy!

------
roneesh
I'm really excited for all these new changes in JS. ES6 and onward is
beginning to feel like a whole new language.

------
morenoh149
So does anyone have a link to "Java Intermediate Bytecode" can't find the
paper for free online.

------
mrnaught
They said all those things to Java too. And still it is everywhere. So always
bet on Java.

~~~
BrendanEich
But not on the client side.

------
smrtinsert
Building out a large app in angular lately has reminded with renewed vigor why
I hate js.

------
peter303
Why did they ever have to confuse the named with the Java programming
language? They are quite different.

[https://www.w3.org/community/webed/wiki/A_Short_History_of_J...](https://www.w3.org/community/webed/wiki/A_Short_History_of_JavaScript)

~~~
tedunangst
Read your own link? "This was somewhat of a marketing move at the time, with
Java being very popular around then."

------
crobertsbmw
All I get is a link to Brendan's twitter account. WTF?

~~~
crobertsbmw
Right arrow....Dumb.

------
sagivo
javascript is so bad that it's great! i love it and love even more what it
becomes lately.

------
bitL
I wish JavaScript "committed a teenager suicide" and we finally got a more
sane language for the web. It's startling how much energy is spent to work
around its bad design every day and it's not getting any better, people are
just getting used to it (which is akin to voluntarily agree with having most
of one's brain blown off). Even seeing Brendan showing off that he hacked the
language in 10 days makes me sick to the stomach...

~~~
hinkley
I struggle with a couple different tools that were developed in weeks or a
couple months or on a plane ride.

Every time these guys brag about how quickly they put together the first
version I just want to say to them, "yeah, we can all tell. And every day we
suffer for it."

~~~
to3m
Yes. There's just no substitute for time. It's impressive to see something put
together quickly, but the result is inevitably lacking in some (or more) ways.

In this talk, I couldn't decide whether his saying JS was written in ten days
was a rueful admission that it's only natural for it to be a huge pile of
shit, or some self-aggrandizement based on how quickly he managed to write it.
I always found JS rather tasteless, so, naturally predisposed to think
somewhat uncharitably of its author, I'm going to assume it's self-
aggrandizement. This might be a bit rude of me, but if it's OK to rush out JS
then slowly make it ever so slightly better over the next 20 years, then I
think it's OK for me to form my opinions in the same manner ;)

~~~
BrendanEich
Hume's Guillotine slices again! Please think through this keynote at a
conference. I was asked to talk about the early days of JS. Why do you suppose
that I am aggrandizing by describing "is" (or "was") as if "ought" can be
derived in a moral sense?

JS happened, I made it in ten days because it wouldn't have happened
otherwise. Had I thought it through, I might have insisted on more time -- but
then: VBScript.

We don't get to call these shots. Taste and morality have little to do with
their hitting targets (whether the ones we aimed at, or others). All the good
stuff in JS came from giants on whose shoulders or heads I stood.

I'm not a nihilist or materialist, but I have to laugh after 20 years. JS was
not planned out this far in advance!

Anyhoo, my sense of self does not depend on ten days in May 1995. My work on
the Web, not just JS but especially on Mozilla, Firefox, and HTML5, doesn't
need aggrandizement. My best work has yet to be seen. I'm not doing these
talks to boast. Peace.

~~~
tomtom2
Just ignore the trolls, most of these naysayers have never implemented a new
programming language in their life, but they feel entitled to talk about
_taste_ and morality.

~~~
bitL
Maybe we have implemented, maybe one maybe more than one. Aren't we allowed to
say what we think?

