Hacker News new | ask | show | jobs
by Klathmon 2712 days ago
I feel like i'm spamming this link every time the private fields stuff comes up, but take a look at the FAQ, it explains the reasoning behind it and why they didn't go with alternate options (like underscore, private, or others).

I was against it at first, but after reading through that document, i'm on their side now. It'll be a small but useful addition in some situations, and it's scope is extremely limited.

https://github.com/tc39/proposal-class-fields/blob/master/PR...

1 comments

Thank you for that link, will read it carefully. From the first glance it feels like an attempt to cover mess with a bigger mess:

> this is already a source of enough confusion in JS; we'd prefer not to make it worse

> Property access semantics are already complicated, and we don't want to slow down every property access just to add this feature.

> [private x] in JavaScript this would silently create or access a public field

Pardon me, but # as a declaration method of privates is an abomination.

Yeah I have to agree with this. I'm getting this vibe from a lot of changes to JS lately. A mess designed to cover another mess and people almost blindly supporting the new mess just because there is some logical rationale for it.