- #1
I_am_learning
- 682
- 16
I am reading on Object Oriented Programming and I feel a bit uncomfortable with the concept of Encapsulation.
And Its kind of funny when programmers first hide (encapsulate) the data and then start to make methods to read and set the data. Sort of like Breaking your own leg and then making a wheelchair.
Concept of Encapsulation feels like a great conspiracy! :D
And I keep wondering, how can someone 'accidentally' COMPOSE code (to change data) ? We far more frequently accidentally mistype and misspell than accidentally compose code. If a programmer wants to change property of an object, he knows what he is doing. Programmer do know what they are doing in lots of other places, then why here are they distrusted?"Encapsulation helps encapsulate data so that code outside of the class can't change it accidentally."
And Its kind of funny when programmers first hide (encapsulate) the data and then start to make methods to read and set the data. Sort of like Breaking your own leg and then making a wheelchair.
Concept of Encapsulation feels like a great conspiracy! :D