News for hackers. Stuff that matters.
Re:V8 release v7.2 by throwaway427 on Tuesday December 18, 2018 @04:37PM (#18710817)
This is not how Ruby and Python works, I believe. I guess it's debatable which paradigm JavaScript is more similar to.
Re:V8 release v7.2 by munificent on Tuesday December 18, 2018 @05:09PM (#18711054)
Python name-mangles properties that start with "__" to emulate privacy. Run:

    class Base:
      def __init__(self):
        self.__field = 1

      def baseMethod(self):
        print("baseMethod " + str(self.__field))

    class Derived(Base):
      def __init__(self):
        super().__init__()
        self.__field = 2

      def derivedMethod(self):
        print("barMethod " + str(self.__field))

    d = Derived()
    d.baseMethod()
    d.derivedMethod()
And it prints:

    baseMethod 1
    barMethod 2
Ruby doesn't really have fields that are private to subclasses, but Ruby also embraces monkey-patching, so that's not entirely surprising.