JavaScript TC39 implementing hashmark private class fields
1–10 of 81 posts
Re: JavaScript TC39 implementing hashmark private class fields
#2Kinda disappointing. I don't really like the # for privates. It's not an elegant solution. It feels a bit like a one-off hack honestly.
Re: JavaScript TC39 implementing hashmark private class fields
#3Can someone provide some context? This link just drops you into the middle of the argument.
Re: JavaScript TC39 implementing hashmark private class fields
#4Kinda disappointing. I don't really like the # for privates. It's not an elegant solution. It feels a bit like a one-off hack honestly.
There's not really a better way while maintaining encapsulation.
Re: JavaScript TC39 implementing hashmark private class fields
#5Kinda disappointing. I don't really like the # for privates. It's not an elegant solution. It feels a bit like a one-off hack honestly.
Right now I'm prefixing variables I don't want external actors to change with underscores, which doesn't actually do anything, so is arguably more of a hack. :P
Re: JavaScript TC39 implementing hashmark private class fields
#6Background for this proposal and discussion can be found in this repo’s README and additional docs:
Re: JavaScript TC39 implementing hashmark private class fields
#7Seems like a pretty fair and well though out solution after reading the latest response by bakkot.
Re: JavaScript TC39 implementing hashmark private class fields
#8Javascript is a poorly-designed, committee-managed, machine-oriented intermediate language. Why should hackers care?
Re: JavaScript TC39 implementing hashmark private class fields
#9Seems like a pretty fair and well though out solution after reading the latest response by bakkot.
Agreed. I've been following the spec for a few months and while # is "ugly," it serves the purpose of the concept well and works with the current spec/implementations without much headache. Seems like a win-win to me and I haven't seen a convincing argument for why private # properties shouldn't move forward as they are.
Re: JavaScript TC39 implementing hashmark private class fields
#10Can someone provide some context? This link just drops you into the middle of the argument.
Some in the JavaScript community have been asking for private members as a language feature and some folks do not want this as there is a subset of JavaScript programmers who worry about many concepts from OOP "polluting" the relative minimalism of JavaScript. A fear I share to a certain extent.
From reading the thread it sounds like some feel that the addition of private members is being accomplished by fiat rather than community consensus.