Posted 16 February 2002 - 04:41 PM
I am creating a lot of classes for the games I make, and in all the reference books I read, variables should be defined as private. But these books were all for systems programming, and none considered speed an issue. So whenever I need to get a variable, I have to call a function to retrieve it or alter it. Is this a preferable method when using Object-Oriented programming, or should I make all my variables public for speed reasons?