Live data from Hacker News

The Birth and Death of JavaScript [video]

destroyallsoftware.com

51–60 of 236 posts

Re: The Birth and Death of JavaScript [video]

#52

He says several times that JavaScript succeeded in spite of being a bad language because it was the only choice. How come we're not all writing Java applets or Flash apps?

Well, about ten or fifteen years ago, "we all were" would have been the answer. Except that back then, there were multiple choices -- plug-ins meant you could choose Java, or Flash, or ActiveX (Visual Basic 6, anyone?), or VRML for that matter.

The number of security issues that plug-ins have had in the last two decades makes most of them non-starters nowadays, although there are still plenty of sites that use them extensively (say, Childrens' game websites like Neopets and Nick Jr.'s website) depending on the target audience.

Re: The Birth and Death of JavaScript [video]

#53
post #2

For context, this was one of the most enjoyed talks at PyCon this year.

I was fortunate enough to get to see this at CUSEC (the Canadian University Software Engineering Conference) and would similarly agree that this was one of the most enjoyed talks there, too.

Re: The Birth and Death of JavaScript [video]

#55

Consider the relationship between Chromebooks and METAL. (I'm typing this from my Pixel...)

Bernhardt later tweeted:

"I gave The Birth & Death of JavaScript seven times and no one ever asked why METAL wasn't written in Rust."

https://twitter.com/garybernhardt/status/456875300580651009

Re: The Birth and Death of JavaScript [video]

#56

He says several times that JavaScript succeeded in spite of being a bad language because it was the only choice. How come we're not all writing Java applets or Flash apps?

Because Java, Flash, etc. couldn't easily manipulate the DOM.

Javascript won for this reason.

Re: The Birth and Death of JavaScript [video]

#57

> xs = ['10', '10', '10'] > xs.map(parseInt) [10, NaN, 2] Javascript is beautiful.

I just wrote this line about two hours ago and my tests weren't thorough enough to catch the bug it introduced. Just when I thought I knew JavaScript. Thanks for saving me some time.

Always give the base to parseInt in Javascript.

Always. The moment you don't, all kinds of bugs follow.

I have to go cry now at the number of times this has bitten me.

Re: The Birth and Death of JavaScript [video]

#58
post #29

Earlier quoted context omitted.

There are so many good WTFs in JS, but this is not one. parseInt expects 2 arguments and Array.prototype.map provides 3 to the callback it is given. Both of these facts are very well documented and known. var mappableParseInt = function(str){ return parseInt(str, 10); }; ['10', '10', '10'].map(mappableParseInt); I'd suspect this snippet is more a snipe at people who don't know JS very well and expect parseInt to be b…

You could say it's a snipe at the weak type system that Javascript has. I dunno, as someone without much experience with Javascript, it is a little odd that arrays return the index alongside the value by default.

It has little to do with the type system. Variadic arguments can be typed given a type system that supports it.

Re: The Birth and Death of JavaScript [video]

#59

Earlier quoted context omitted.

I just wrote this line about two hours ago and my tests weren't thorough enough to catch the bug it introduced. Just when I thought I knew JavaScript. Thanks for saving me some time.

I'm sure you know this by now but you can keep the syntax and use Number instead xs.parseInt(Number)

I think xs.map(Math.floor) takes the cake if I recall speed tests properly

Re: The Birth and Death of JavaScript [video]

#60
post #9

nice nice,ultimatly languages dont die,unless they are closed source and used for a single purpose ( AS3 ). In 2035,people will still be writing Javascript. I wonder what the language will look like though. Will it get type hinting like PHP? or type coercion? will it enforce strict encapsulation and message passing like Ruby ? will I be able to create adhoc functions just by implementing call/apply on an object? or s…

AS3 is not dead, and it is now open source
Post reply on HN