News for hackers. Stuff that matters.
Re:Facebook Announces React Fiber, a Rewrite of Its React Fr... by jakelazaroff on Wednesday April 19, 2017 @01:05AM (#14145556)
> now we have two incompatible inheritance systems instead.

JavaScript still only has prototypal inheritance; class syntax is just sugar[1].

> Meanwhile `this` still doesn't mean "this"

Even with arrow functions, which don't change the binding of "this"[2]?

> there's still no... boolean types

typeof false === "boolean"

> accessing a nonexistent variable silently fails but happily continues execution

Trying to access a nonexistent variable throws a ReferenceError[3].

> no decent debugger

I disagree, but regardless — doesn't the fault here lie with browsers, not the language itself?

We also get a module system, object and array destructuring, async/await, template strings, generators… it's pretty difficult to say the new ES features are "a step backward".

[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... [2] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... [3] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Re:Facebook Announces React Fiber, a Rewrite of Its React Fr... by kerkeslager on Wednesday April 19, 2017 @08:23AM (#14147193)
> JavaScript still only has prototypal inheritance; class syntax is just sugar[1].

Sure, but the patterns you use with the class syntax are incompatible with the patterns you use when using object literals, so libraries pick one or the other, typically the class way.

> Even with arrow functions, which don't change the binding of "this"[2]?

Even with arrow functions, `function` still exists ands is more frequently used.

> Trying to access a nonexistent variable throws a ReferenceError[3].

var a = {};

var b = a.c;

Doesn't throw a ReferenceError for me.

Re:Facebook Announces React Fiber, a Rewrite of Its React Fr... by jakelazaroff on Wednesday April 19, 2017 @10:24AM (#14147891)
> Sure, but the patterns you use with the class syntax are incompatible with the patterns you use when using object literals

How so? You can still access the prototype. It's just that the most common reason to — declaring instance methods — can be accomplished with the easier-to-read class syntax now.

> Even with arrow functions, `function` still exists ands is more frequently used.

ES6 is a non-breaking change. You can use arrow functions for literally every function you write other than generators.

> var a = {}; > var b = a.c;

That's a nonexistent property, which probably should throw some sort of error — but that's why we have tools like TypeScript and Flow that can detect this.

Re:Facebook Announces React Fiber, a Rewrite of Its React Fr... by fauigerzigerk on Wednesday April 19, 2017 @01:07PM (#14149424)
>You can use arrow functions for literally every function you write other than generators

But not for every function I read, and that is the problem with all backward compatible fixes to programming languages. You're just piling on more (sometimes better) features on top of all the old brokenness and everybody has to know all of it.

Re:Facebook Announces React Fiber, a Rewrite of Its React Fr... by ng12 on Wednesday April 19, 2017 @01:21PM (#14149607)
Yeah but that's in no way unique to Javascript. Java developers still have to deal with type erasure due to decisions that were made 20 years ago.
Re:Facebook Announces React Fiber, a Rewrite of Its React Fr... by jakelazaroff on Wednesday April 19, 2017 @03:21PM (#14150878)
True. I'm not trying to say JavaScript is or was great, just that ES6 is pretty clearly not a step backward (which was the original claim).