News for hackers. Stuff that matters.
Re:The Birth and Death of JavaScript [video] by vor_ on Thursday April 17, 2014 @06:28PM (#7606900)
Classic video, though it's wrong at times. For instance, the audience member who corrected him was right.
Re:The Birth and Death of JavaScript [video] by robert-boehnke on Thursday April 17, 2014 @06:35PM (#7606935)
couldn't quite make it out, what did he correct?
Re:The Birth and Death of JavaScript [video] by vor_ on Thursday April 17, 2014 @08:42PM (#7607396)
The second JavaScript example, when he told someone in the audience, "No, that's just an object." It was a string.
Re:The Birth and Death of JavaScript [video] by gary_bernhardt on Thursday April 17, 2014 @09:43PM (#7607577)
I knew that it was a string. If you listen closely, you'll hear that he asked "is that an array of object?" He probably asked that because it's in square brackets. I said "No, it's just an object".

I've probably seen twenty people call this "wrong", which frustrates me. It's not wrong. It was a stringified object! I didn't say "stringified" because it wasn't relevant to the question of whether the object was in an array!

There are other things in Wat that are genuinely wrong, though, like the fencepost error about "16 commas", which mistake will haunt me forever.

Re:The Birth and Death of JavaScript [video] by calibwam on Friday April 18, 2014 @06:51AM (#7608714)
It is wrong because it is the toString of Object, because the + operator wants to do string concatenation. You were misleading the audience, both by using a shell which doesn't show strings with quotes, and saying that the toString of the object is 'just an object'.

And that is not the only thing that is misleading, as you clealy said that {} was an object. Yes, the syntax in js is weird as it looks like an object, but it isn't. Again, a better shell would not let you do this.

Re:The Birth and Death of JavaScript [video] by nilliams on Friday April 18, 2014 @07:53AM (#7608838)
As gary explained he wasn't wrong in his response to the question because the audience member was asking whether [object Object] means the object is in an array. It doesn't. The string point is moot.

I do agree the {} + [] example has always felt a bit unfair to me (for the reason that {} is a block), but whatever, it's a light-hearted talk.

Re:The Birth and Death of JavaScript [video] by saraid216 on Thursday April 17, 2014 @10:38PM (#7607702)
Maybe worth releasing a transcript, at this point?
Re:The Birth and Death of JavaScript [video] by hetid on Friday April 18, 2014 @12:28AM (#7607937)
It's only 15 commas man, 15 commas. That extra comma could kill someone.

Speaking of which, why does WAT do different things on node.js?

Re:The Birth and Death of JavaScript [video] by Turing_Machine on Friday April 18, 2014 @01:45AM (#7608087)
"That extra comma could kill someone."

Only in old versions of Internet Explorer.

Re:The Birth and Death of JavaScript [video] by espadrine on Friday April 18, 2014 @05:12AM (#7608538)
> why does WAT do different things on node.js?

Wrapping the same input in parenthesis (eg, '({} + [])') yields different results.