Original Post
I've been experimenting with C++, and it seems that access modifiers (i.e. public/private) do nothing to change the underlying machine code that is produced and can easily be circumvented. It seems to me that they are merely a comment, and if that's the case why do we have them at all? "//" comments should do the job just as well. I've come to the conculsion that the only way to protect data, is to keep it unknown. That is, to make sure that the user doesn't have enough information about the data to make use of it. For example, while internally a class contains "int var1, var2, var3;", on the external frontend that the user manipulates the same code is shown as "char data[12];". This to me is the only true private data. So, as the topic states, what the point of access modifiers? imho, they can only serve to make a language overly complex. [Edited by - DudeMiester on January 16, 2005 12:38:26 PM]