I've been learning C++ for some weeks now, and I have already developed a relatively complex program (an Arkanoid clone in SFML!! still in alpha version, though...) I've used the vast majority of the topics introduced in this site's tutorial, except for a couple: pointers and private members of a class.
With pointers, I believe I'll understand their function when the need for them arises. But with private members, I just don't get why I wouldn't want to be able to call/modify any class' member from anywhere within the program.
I would greatly appreciate any light on this subject. Thanks in advance!
Preference of abstraction. In C, everything is shown so there is hardly abstraction. Its up to you... Although there are times where making a variable private should be obvious.
I may be wrong on this, but it is my understanding that c++ was designed for large projects for teams of programmers. It seems to me anyway, that many of the features of c++, do not add that much (if any) actual functionality (typedef's and enum's for instance), but rather help to manage these large projects. If one programmer or small team of programmers writes a class that other programmers are going to use to implement some other portion of the software project, it may help to have certain member variables declared as private so that the class will not end up being used for something other than its intended purpose. This speeds up development time significantly because other groups will not have to test & debug multiple sections of code repeatedly, because presumably the testing & debugging of the class has already been done.