Classes do not support data hiding.
I am grateful for the addition of classes in PS, and I know why PowerShell classes do not support true data hiding, but it is a significant shortcoming. It does not allow full control of setting a property for example. I can write my own class method for setting it, but it can be changed outside of that method. And if that method also updates the value of another class property, it can get changed directly, without going through the desired logic so the class method can be bypassed.
And it is nice to have the get and set automatically defined for class properties, but at times I want to disallow a set_ and I am unable to do so (as far as I can tell). If there is a way to do so already, please let me know.
So I would like hidden to be hidden or a private attribute or whatever. Without it, we are reduced to a somewhat cleaner bit of procedural programming.
Mike Lewis commented
Per one definition of OOP:
•Encapsulation: This makes the program structure easier to manage because each object’s implementation and state are hidden behind well-defined boundaries. Note "hidden".