Message from JavaScript discussions

June 2017

— What do you guys think of the proposed # alias and #private keyword? It would allow objects to access private members of other instances of the same object.

Message permanent page


I found this guy's reasoning to be pretty much on-par with my own, and I definitely want to see some real discussion like this:

"Reasoning from static, strongly-typed, closed-object languages to weakly typed, dynamic and open-object languages just doesn't work, so concepts like the private keyword that work very well in some languages (eg, Java) are a complete non-starter in JS. It's like jamming a round peg into a square hole, because JS is a totally different scenario with totally different considerations."

— You should see the discussion going on outside the group. Not only are the original reasons in the proposition git repo absolute contradictory nonsense, but it's bad enough people are writing out the words "mediocre developer" upon reading it. Most people just want easier private members in general, not the "because Java does it" cross-instance access... But I don't tend to settle on my own opinions so I want to see what you folks think about it :)

Message permanent page

— Http://

— Https://

— I personally think all the class syntax was a mistake (although I HAVE used it and it IS useful), but why wouldn't you support something like this, to make it easier for the OOP guys?

Message permanent page

— It's familiar, it doesn't affect performance, anyone who doesn't understand it immediately can just google "JavaScript class hash"

Message permanent page

— Great if you're already using class syntax, no difference if you don't

— I just think it does too much, and is trying to solve a problem which already has elegant, JS-centric solutions. While JS is certainly in need of help with OOP, adding another keyword and a this alias adds nothing of value in my opinion, it's just piling some minute refinement on top of a lacking system without actually fixing the system. Do we *need* to access private properties from outside the class? If so, there are other ways, and also you should really re-evaluate why you need to do this in the first place!

Message permanent page

— From *inside the class

— I also think using Java as a qualifier is not, uh... good, at all. Heh. Let's just say Java does some things C++ developers would consider paramount to treason

Message permanent page

— Kek, yes, Java as an argument is dumb, since they have nothing to do with eachother