2 ms·
Encapsulation can an excellent step in making a problem go away. First a mistake is made all over your code. Then it's made only in the private method. Then it
by joe_the_user 17y ago
Encapsulation can an excellent step in making a problem go away.
First a mistake is made all over your code. Then it's made only in the private method. Then it can be changed easily -- and reverted easily if the change doesn't work.
Of course, this isn't always a good idea. But there are many times that it can be a good idea.