News for hackers. Stuff that matters.
Re:JavaScript TC39 implementing hashmark private class fields by JoshTriplett on Thursday August 03, 2017 @03:02PM (#14922655)
> 1. Members marked private being accessible from other instances of the same class [1] is counter to every other OO language I have used. What is the prior art here? Why depart from all conventions like this?

C++ works that way, and several other languages do as well. And the use case mentioned in that comment is exactly the reason: the implementation of a class knows how to access both its own private fields and those of another instance of itself, so that it can do comparisons, combinations, or other operations.

Re:JavaScript TC39 implementing hashmark private class fields by spankalee on Thursday August 03, 2017 @03:24PM (#14922893)
It gets really tricky when you have any kind of polymorphism, intended or not.

If you accept instances of your own class as arguments to a method, you may be templated to think you can access the private fields of those arguments, even if instanceof checks pass, but they may not be there.