Is it fair to say that it is good practice to default everything to private up when defining a class?
For example, for my public interface I would set my class something like this:
class foo {
private var x
private var y
//even get and set are private,
//public only if necessary
private get/set method for variables
//main function
private coreFunc () {...}
//helper function
public callCoreFunc() {
coreFunc()
}
}
I'm used (and got used from my algorithm teacher) that everything in a class should be private, except for the methods that the user need to call (with wrapped helper function.)
Is this a good way to see "public interface" or is this too strict?