Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!mcgill-vision!snorkelwacker!usc!cs.utexas.edu!rutgers!att!drutx!cbnewsb!druhi.att.com!neal From: neal@druhi.att.com (XGPB30000-McBurnettND(DR9225)289) Newsgroups: comp.lang.c++ Subject: Re: Default class members Message-ID: <460@cbnewsb.ATT.COM> Date: 3 May 90 14:18:48 GMT References: <6917@odin.corp.sgi.com> Sender: news@cbnewsb.ATT.COM Reply-To: neal@druhi.ATT.COM (Neal D. McBurnett) Organization: AT&T Bell Labs, Denver CO Lines: 23 In article <6917@odin.corp.sgi.com>, shap@thebeach.wpd.sgi.com (Jonathan Shapiro) writes: > The point of which is, isn't it time to consider making 'protected' be > the default state at the top of a class, rather than 'private?' I > believe that having private as the default is an artifact of the > language versions that existed before the protected keyword. I'm not sure what I think of your suggestion that protected members should be used more often than private members. Whether or not that is the case, I definitely think we should encourage people to put public members first in their classes. This makes it easier for the most important customer of the class definition, the customer, to see what the public interface is. While I know that this could be done by using a "struct", I think it is clearer to use a "class" and put the keyword "public:" at the top of the class. This idea was the subject of a paper by Peter Kirslis at the first USENIX C++ conference. I also think it would be a bad idea to modify the default semantics of the language in a way which might break existing code. -Neal McBurnett // AT&T Bell Labs, Denver // neal@druhi.ATT.COM,att!druhi!neal'