Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool2.mu.edu!uunet!microsoft!jimad From: jimad@microsoft.UUCP (Jim ADCOCK) Newsgroups: comp.lang.c++ Subject: Naming Conventions Message-ID: <60352@microsoft.UUCP> Date: 8 Jan 91 20:28:25 GMT Reply-To: jimad@microsoft.UUCP (Jim ADCOCK) Organization: Microsoft Corp., Redmond WA Lines: 65 As the library committee begins to propose classes and libraries to standardize, I wish to mention a subject that will probably provoke howls of anguish from all involved, namely: Naming Conventions. My suggestion is that [besides being almost impossible to agree on] naming conventions need to be agreed upon in order to have standarized software, and that the exact names chosen for standard libraries and classes are important to their reusability. Some names suggested for use in standard libraries to date include, I believe: complex iostream istream ostream String which seem to represent at least three different styles of naming. --- A humble suggestion: "simple" standard classes, that follow value semantics, and are intended as extensions to the built-in primitive types of the language, should be named in a manner as similar as possible to the built-in types of the language. "Good" names for "simple" standard classes then, might include: complex stream string Preferred names for these "not-built-in primitive-like" classes then, would be lower case, not include underbars, be one word, or one abbreviated word. The extended primitive, and primitive-like set of types available for C++ programmer would then include: int long char double unsigned complex stream string --- I do not here suggest what proper naming conventions should be for standard classes that are _not_ intended as "simple" extensions to the built-in primitive types, but rather are intended to be used in an "object oriented" manner, accessed via pointer or reference, in a polymorphic manner. The defacto standard for such classes seems to me to be: whole words, first letter capitalized, word breaks capitalized, no underbars: Object Set Bag MultipleWordName I believe if the committee did decide that "simple" value semantics standard classes should be all lower case like built-in types, whereas as "complicated" standard classes intended to be used with derivation, polymorphism, etc, start with a capital, then this would be _a_ good choice, helpful to C++ programmers by clarifying the difference in uses of these two types of classes.