News for hackers. Stuff that matters.
Re:Classes are Expressions by quad50 on Friday June 05, 2015 @10:18AM (#9665630)
What are the reasons for keeping components of a 'thing' private? I go back and forth on this.

1. expose a clean API surface so users don't care how it works (as long as it works :)

2. make it easier to change the innards without changing its public behavior

3. keep malicious programmers from delving into the innards of our precious code.

It seems like a lot of the discussions on encapsulation (over many years) focuses on #3. Especially in the C++ and Java world. But worrying about that leads to various forms of obfuscation that make the code worse. And who cares about folks who will hack our objects? That's their problem.

Re:Classes are Expressions by gotofritz on Saturday June 13, 2015 @05:42PM (#9712791)
It doesn't have to be "malicious" programmers. It can be less experienced, lazy, or under-pressure colleagues.