Why make class variables private?
Okay, so I keep coming across the practice of making class variable private and using getter and setter methods for other classes to interact with these variables.
I tried looking for some explanations but what I have found is that it is "good practice" to do so.
However, as I code, sometimes I find my code is longer and it is more tedious to write when I need to write getter and setter methods for everything. Why not just make them public? Especially when it is not a big deal. So basically, I'm looking for real reasons for not making them public, apart from being "good practice".
I mean, I understand if you don't want an external class to modify these methods by accident, yet this external class could access the getter and setter methods, producing the exact same result.
Sorry for my ignorance in this respect.