News for hackers. Stuff that matters.
Re:JavaScript Records and Tuples Proposal goes to stage 2 by mcraiha on Thursday July 23, 2020 @12:25PM (#23929036)
"Records and Tuples aim to be usable and understood with external typesystem supersets such as TypeScript or Flow." Must be fun to design stuff that shouldn't break your language nor other languages.
Re:JavaScript Records and Tuples Proposal goes to stage 2 by rsstack on Thursday July 23, 2020 @12:47PM (#23929272)
Immutability and structural equality will make these extremely useful. I'm concerned how the masses of recent grads and bootcamp grads will interact with these. One of my favorite JS interview questions is "what is the difference between var, let, and const?". I don't reject candidates based on it, I just like hearing the different answers. I only heard the correct answer once out of all the entry-level developers that I interviewed.
Re:JavaScript Records and Tuples Proposal goes to stage 2 by TheCoelacanth on Thursday July 23, 2020 @01:44PM (#23929998)
I'm more concerned with the way that recent grads and bootcamp grads will interact with everything else.

Reference equality is a huge source of confusion for them. Structural equality is what they expect.

Re:JavaScript Records and Tuples Proposal goes to stage 2 by rsstack on Thursday July 23, 2020 @03:22PM (#23931220)
It's what they expect, and it's what they'll now expect from every object or object'ish value in JS :)
Re:JavaScript Records and Tuples Proposal goes to stage 2 by simplify on Thursday July 23, 2020 @01:48PM (#23930044)
I was thinking "what's the point?" until I reached the section on equality:

    #{ a: 1 } === #{ a: 1 }  //=> true
This is massively useful.
Re:JavaScript Records and Tuples Proposal goes to stage 2 by syspec on Thursday July 23, 2020 @11:46AM (#23928570)
I'd rather just be able to mark an object as frozen, which we can already do.

JavaScript is adding so much new syntax I feel bad for people starting to learn the language now.

Re:JavaScript Records and Tuples Proposal goes to stage 2 by jakelazaroff on Thursday July 23, 2020 @11:50AM (#23928615)
In terms of syntax this seems pretty lightweight, though. It's the same as instantiating a normal object or array, except with a hash in front.
Re:JavaScript Records and Tuples Proposal goes to stage 2 by oweiler on Thursday July 23, 2020 @02:51PM (#23930870)
It's lightweight, but also looks obscure and will probably be hard to google.