Topic: C++ coding conventions


Author: jb8285@medtronic.COM (Jeffrey R. Brown)
Date: Thu, 9 Sep 1993 18:04:09 GMT
Raw View
Paul J Lucas (grumpy@cbnewse.cb.att.com) wrote:
> From article <sbartonCCG1rL.M0@netcom.com>, by sbarton@netcom.com (Sharon Barton):
> > Anyone know of any widely used C++ coding conventions?  If so,
> > where can I get a copy of them?

>  1. wrong newsgroup.

>  2. coding conventions are useless.
> --
>  - Paul J. Lucas
>    AT&T Bell Laboratories
>    Naperville, IL

On the contrary, this IS the right newsgroup.  Coding conventions,
styles, idioms of usage, are, in fact, part of the informal process of
standardization that occurs with any programming language.  It is only
the formal standardization affecting the definition of the language
that goes through the ANSI committee.

Unfortunately, I do not know of any WIDELY used C++ coding standards
or conventions.  One document that is available publicly is:

  Programming in C++
  Rules and Recommendations

This is available from:

  Ellemtel Telecommunication Systems Laboratories
  Box 1505
  125 25 Alvsjo
  Sweden
  (tel: 46 8 727 30 00)

Please note that I am not endorsing Ellemtel's coding conventions.  In
fact, I disagree with some of them.  But it is a good place to start.

I also would like to point out that AT&T Bell Labs (Mr. Lucas's
employer) does have a set of C++ coding standards/conventions, at
least in one location.  However, the standard is proprietary.  (I wish
they would release it to the public domain!)

--
"The comments and opinions expressed above are mine and do not necessarily
represent the official position or views of Medtronic, Inc."
Jeffrey R. Brown
Internet: jeffrey.brown@medtronic.com             Voice: 1-612-574-4698
UUCP:     uunet!medtron!jb8285                    FAX:   1-612-574-6150




Author: marcus@x4u.desy.de (Marcus Speh)
Date: Sat, 11 Sep 1993 15:12:51 GMT
Raw View
>>>>> On Thu, 9 Sep 1993 18:04:09 GMT, jb8285@medtronic.COM (Jeffrey R. Brown) said:
> From article <sbartonCCG1rL.M0@netcom.com>, by sbarton@netcom.com (Sharon Barton):
> > Anyone know of any widely used C++ coding conventions?  If so,
> > where can I get a copy of them?

Jeffrey> Unfortunately, I do not know of any WIDELY used C++ coding standards
Jeffrey> or conventions.  One document that is available publicly is:

Jeffrey>   Programming in C++
Jeffrey>   Rules and Recommendations

Jeffrey> This is available from:

Jeffrey>   Ellemtel Telecommunication Systems Laboratories
Jeffrey>   Box 1505
Jeffrey>   125 25 Alvsjo
Jeffrey>   Sweden
Jeffrey>   (tel: 46 8 727 30 00)

This document is available as a Postscript file e.g. from the freeHEP
information server,

 freehep.scri.fsu.edu [144.174.128.21]


in file

 /freehep/C++/reviews/c++.rules.ps

there are more files. For even more info, read the file
'More-is-on-WWW' in the same directory.
Many of these rules are being used (and discussed) for the ongoing
effort of a class library for high energy physics (CLHEP).

--
/////////////////////////////////////////////////////////////////////////////
Marcus Speh, II.Inst.Theor.Physik,Luruper Chaussee 149, 22761 Hamburg,Germany
Phone: +49-40 8998 2178, Fax: +49-40 8998 2267, Private: +49-40 801392
Internet: <marcus@x4u.desy.de> BITNET:<I02MSP@DHHDESY3>  DECnet:<13313::SPEH>







Author: vr@CAM.ORG (Alain Lauzon)
Date: 10 Sep 1993 22:49:22 -0400
Raw View
jb8285@medtronic.COM (Jeffrey R. Brown) writes:

>Paul J Lucas (grumpy@cbnewse.cb.att.com) wrote:
>> From article <sbartonCCG1rL.M0@netcom.com>, by sbarton@netcom.com (Sharon Barton):
>> > Anyone know of any widely used C++ coding conventions?  If so,
>> > where can I get a copy of them?

>>  1. wrong newsgroup.

>>  2. coding conventions are useless.
>> --
>>  - Paul J. Lucas
>>    AT&T Bell Laboratories
>>    Naperville, IL

>On the contrary, this IS the right newsgroup.  Coding conventions,
>styles, idioms of usage, are, in fact, part of the informal process of
>standardization that occurs with any programming language.  It is only
>the formal standardization affecting the definition of the language
>that goes through the ANSI committee.

>Unfortunately, I do not know of any WIDELY used C++ coding standards
>or conventions.  One document that is available publicly is:

>  Programming in C++
>  Rules and Recommendations

>This is available from:

>  Ellemtel Telecommunication Systems Laboratories
>  Box 1505
>  125 25 Alvsjo
>  Sweden
>  (tel: 46 8 727 30 00)

This document is also available trough a ftp site:
ftp.desy.de: /pub/c++/misc/c++.rules.ps

Alain Lauzon





Author: euamts@eua.ericsson.se (Mats Henricson)
Date: Mon, 13 Sep 1993 08:14:35 GMT
Raw View
In article 28308@medtron.medtronic.com, jb8285@medtronic.COM (Jeffrey R. Brown) writes:
>Paul J Lucas (grumpy@cbnewse.cb.att.com) wrote:
>Unfortunately, I do not know of any WIDELY used C++ coding standards
>or conventions.  One document that is available publicly is:
>
>  Programming in C++
>  Rules and Recommendations
>
>This is available from:
>
>  Ellemtel Telecommunication Systems Laboratories
>  Box 1505
>  125 25 Alvsjo
>  Sweden
>  (tel: 46 8 727 30 00)

Hi!

There are a few different formats of the document on our ftp server.
It is all described below.

Best regards,

Mats Henricson
Ellemtel Telecom Systems Labs
Stockholm
Sweden
====================================================================
"Public Domain" Coding standards for C++ in ENGLISH

Hi!

Our programming standard for C++ has finally been translated to English.
In addition, some minor changes have been made. We believe that this
version is rather stable, so that the next version should not be expected
for quite a while.

Many people have aversions against programming standards. We recognize this
and have therefore tried to make our document as flexible as possible.
We have a set of 51 RULES (sometimes with exceptions) which we do not see
any reason not to follow. Then we have a set of 79 RECOMMENDATIONS. They
are meant as guidelines. We belive that most code should follow these
recommendations, but we have ourselves recognized times when braking these
recommendations are not only appropriate, but also necessary.

To you who really hate programming rules: we challenge you to try to
reduce the number. We would be all too happy if you succeed, since we too
are programmers and dislike rules ourselves.

The document only touches the subject of C++ design. The chapter on
portability is sketchy. We have also tried to avoid subjects that we
believe belong to an introductionary course in C++.

The document contains 70 code examples. Many are simple, but some are
quite complex. Most examples are possible to compile directly, while some
may need some more or less obvious extra code to make sense for the
compiler.

The document has the same copyright notice as the cool library,
i.e. it is OK to copy and use the document, but we retain the copyrights.
Also, we provide no warranty at all. If any of our code examples destroy
your network, we will simply say "Sorry!".

The document was written using FrameMaker, but has been saved in Postscript
and compressed. It can be accessed by anonymous ftp from our server:
   euagate.eua.ericsson.se   (Internet Address: 134.138.134.16)
It is in the directory:
   ~ftp/pub/eua/c++
The file is ~126k large and its name is:
   rules.ps.Z

Extra info per 1992-12-18:
   The above mentioned document is formatted for A4 paper. There is
   also one document for US Letter, called rules.US.ps.Z. To this you
   can add two similar mif-versions (Maker Interchange Format - editable
   FrameMaker format) called rules.mif.Z and rules.US.mif.Z. Finally
   there is a plain ascii version, called rules.ascii.Z.

Extra info per 1993-03-19:
   Now there is also a plain ascii file called rules.MAX70.ascii. It is
   formatted to have no lines longer than 70 characters. All tabs are
   also removed and exchanged to plain spaces. This is to make it easier
   to print on plain ascii printers.

If there are any problems in accessing or printing the file, please contact
us at:
   rules@eua.ericsson.se

All comments are welcome. Especially if you find any bugs or
misunderstandings from our side. Please make it clear which version
you have comments on, i.e. if you have comments on this version
state "Version C in English" somewhere.

Erik Nyquist
Mats Henricson

Ellemtel
Box 1505
125 25 Alvsjo
Sweden





Author: rfg@netcom.com (Ronald F. Guilmette)
Date: Sun, 5 Sep 1993 06:28:04 GMT
Raw View
In article <USER.2.0010B21F@zew.zew-mannheim.de> USER@zew.zew-mannheim.de (Michael Luebbeke) writes:
>In article <CCH5B6.E0y@cbnewse.cb.att.com> grumpy@cbnewse.cb.att.com (Paul J Lucas) writes:
>
>
>>From article <sbartonCCG1rL.M0@netcom.com>, by sbarton@netcom.com (Sharon Barton):
>>> Anyone know of any widely used C++ coding conventions?  If so,
>>> where can I get a copy of them?
>
>>        1. wrong newsgroup.
>
>>        2. coding conventions are useless.
>>--
>>        - Paul J. Lucas
>>          AT&T Bell Laboratories
>>          Naperville, IL
>
...
>First, I think that this is the very right newsgroup to discuss any aspect of
>c++ standardization.

Well, what can I say?  You're wrong.  Just plain wrong.  This group was
created and dedicated to the purpose of discussing the emerging C++
*language* standard.  Period.  If you wish to discuss some other
*coding conventions* standard, get your own newsgroup.

P.S. Essentially every time I read this group, I find myself annoyed at all
of the postings which are NOT relevant the purpose or charter of this news-
group.

--

-- Ronald F. Guilmette ------------------------------------------------------
------ domain address: rfg@netcom.com ---------------------------------------
------ uucp address: ...!uunet!netcom.com!rfg -------------------------------




Author: kanze@us-es.sel.de (James Kanze)
Date: 8 Sep 93 14:21:56
Raw View
In article <rfgCCvBAt.9uM@netcom.com> rfg@netcom.com (Ronald F.
Guilmette) writes:

|> In article <USER.2.0010B21F@zew.zew-mannheim.de> USER@zew.zew-mannheim.de (Michael Luebbeke) writes:
|> >In article <CCH5B6.E0y@cbnewse.cb.att.com> grumpy@cbnewse.cb.att.com (Paul J Lucas) writes:
|> >
|> >
|> >>From article <sbartonCCG1rL.M0@netcom.com>, by sbarton@netcom.com (Sharon Barton):
|> >>> Anyone know of any widely used C++ coding conventions?  If so,
|> >>> where can I get a copy of them?
|> >
|> >>        1. wrong newsgroup.
|> >
|> >>        2. coding conventions are useless.
|> >>--
|> >>        - Paul J. Lucas
|> >>          AT&T Bell Laboratories
|> >>          Naperville, IL
|> >
|> ...
|> >First, I think that this is the very right newsgroup to discuss any aspect of
|> >c++ standardization.

|> Well, what can I say?  You're wrong.  Just plain wrong.  This group was
|> created and dedicated to the purpose of discussing the emerging C++
|> *language* standard.  Period.  If you wish to discuss some other
|> *coding conventions* standard, get your own newsgroup.

Actually, the statement as it stands is probably right.  But it isn't
relevant to the problem; coding conventions are not an aspect of
standardization (unless someone wants to propose that the language
enforce them).
--
James Kanze                             email: kanze@us-es.sel.de
GABI Software, Sarl., 8 rue du Faisan, F-67000 Strasbourg, France
Conseils en informatique industrielle --
                   -- Beratung in industrieller Datenverarbeitung




Author: USER@zew.zew-mannheim.de (Michael Luebbeke)
Date: Fri, 3 Sep 1993 16:41:38
Raw View
In article <CCH5B6.E0y@cbnewse.cb.att.com> grumpy@cbnewse.cb.att.com (Paul J Lucas) writes:


>From article <sbartonCCG1rL.M0@netcom.com>, by sbarton@netcom.com (Sharon Barton):
>> Anyone know of any widely used C++ coding conventions?  If so,
>> where can I get a copy of them?

>        1. wrong newsgroup.

>        2. coding conventions are useless.
>--
>        - Paul J. Lucas
>          AT&T Bell Laboratories
>          Naperville, IL

Oh what a helpful, exhausting, pleasent answer!. With these 2 lines, the poor
and ignorant newbie sharon will became aware how stupid and abstruse his idea
of coding convention is :-), :-), :-).

Aside from the fact, that those flames aren4t a way to answer a serious
question anyway, I would like to state two things:

First, I think that this is the very right newsgroup to discuss any aspect of
c++ standardization. And even if not, you wouldn4t  suffer from gout by typing
some proposals about a better place :-) .....

Second, coding conventions are the first step towards gaining
highly protable, reusable und maintanance-friendly software. Surely, there are
many disadvantages and many drawbacks in limiting the freedom of any
programmer in a team by demanding a programming style that differs from his
own. But, we do need standardization in any level of programming to
be able to share genius or tidious  programs of other people to gain synergy
effects. How often has every programmer written things like Linked List
modules from the scratch,  just because he couldn4t patch the source code of
linked list modules, which are written in horrably style? In all other aspects
of computer technology we cry for standardization, claimed to be the one and
only way to survive. Only (C++)-programming should be the exception?

I4m actually working on a paper, which deals with conding conventions in C++.
Although this work is restricted in source code text styles (brace-placing,
indenting, naming conventions, sequence of class modules etc.), I4ve read
a lot 4bout the pros and cons of convention style. Part of my work is to build
a tool which can be used to fromat a given source code into a preferred coding
style. This tool will avoid all the drawbacks, when you demand one, single
program style from any programmer in your team.

There are some widly used ( or at least discussed) coding conventions in C++.
I don4t got my bibliography at hand, so, if somebody is intereted, I would
post this later on.

Ciao, so far, and don4t give up, Sharon

Michael Luebbeke








Author: sbarton@netcom.com (Sharon Barton)
Date: Sat, 28 Aug 1993 00:38:07 GMT
Raw View
Anyone know of any widely used C++ coding conventions?  If so,
where can I get a copy of them?

Thanks in advance,

Sharon Barton
sbarton@netcom.com




Author: grumpy@cbnewse.cb.att.com (Paul J Lucas)
Date: Sat, 28 Aug 1993 14:52:15 GMT
Raw View


Author: kla!anil@sun.com (Anil Somani)
Date: 15 Jun 92 16:44:22 GMT
Raw View
I am part of a team of software developers, starting on a project using
Borland C++ and AF. I am looking for coding standards and conventions
which will be helpful during development and later maintenance in a team
environment.

I read about the Hungarian naming convention. Does someone have a
comprehensive list of prefixes for the same.

Thanks for your attention.

--
 Anil Somani               uucp: Sun.Com!kla!anil
 KLA Instruments Corp.     Domain: kla!anil@Sun.Com
 160 Rio Robles            M/S A2-3400, Phone: 408/456-6408
 San Jose, CA 95161-9055   Beep:408/865-7644 Fax:408/434-4284




Author: jimad@microsoft.com (Jim Adcock)
Date: 16 Jun 92 18:31:26 GMT
Raw View
In article <1992Jun15.164422.26999@sun!kla> kla!anil@sun.com (Anil Somani) writes:
>
|I read about the Hungarian naming convention. Does someone have a
|comprehensive list of prefixes for the same.

Take a look at the C7 MFC classes which take hungarian and move in a direction
appropriate for C++ and Windows programming.  In particular, one shouldn't use
hungarian unmodified in C++, because C++ has overloading and OOP has
polymorphism -- two problems that are incorrectly addressed incorrect in
 hungarian if you just apply it blindly in a historical manner.