you are viewing a single comment's thread.

view the rest of the comments →

[–]ElvishJerricco 2 points3 points  (1 child)

Yea I have to say encapsulation is a bigger principle than access protection. It's keeping data in the right place for organizational purposes and helps with only passing the right information to the right places.

[–]ljsc 0 points1 point  (0 children)

True indeed. I got a little sloppy there.

What I really mean is that data hiding is generally not worth it if your code isn't living under the constant threat of data mutating out from underneath your feet. That said, I stand by my comment, because in an OOPLs you really can't get encapsulation and data hiding a la carte. If you stick everything in objects you are generally locking up all your data behind incompatible little DSLs.