Most of the developers, when they hear about encapsulation, they think of it as one of the fundamental concepts in object-oriented programming, and it means that the class (or any component of code) exposes only the relevant data to the outside world and hides the internal data as private members, but this principle is more general and powerful than a lot of developers think, and although it is defined in OOP, you can still apply it one way or another in other programming paradigms.
So, what is the encapsulation all about? …