[Dev-C++] public/private data decision
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <or...@vp...> - 2004-04-12 20:24:52
|
Hi! I have been pondering on this for quite some time, but it seems I cannot=20 get myself to a firm decision. Suppose I have a class, which has some data. Mostly string data. Like=20 name, path, etc. Uptil now I always put these things into the private=20 part of my class, and I provided Get/Set methods for accessing them. I ask: does it worth the extra overhead? I mean, what if I simply put=20 the data into the public section, and then I have 2 (or more) member=20 functions less, and the same access to the data. Can someone with more experience with C++ give some guidelines to me=20 about this. Posting personal experience would be the best! Thank you. -- Greetings, Bal=E1zs |