By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,635 Members | 2,187 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,635 IT Pros & Developers. It's quick & easy.

C++ coding standards

P: n/a
Can anyone recommend a good existing C++ coding standard - parctical,
pragmatic and sensible?

A company I joined recently are moving from C to C++, they are very
much into coding standards. But I have a horibble feeling they might
get a C programmer to write the C++ standard. Would be nice to be able
to suggest an existing standard.
Mar 21 '08 #1
Share this Question
Share on Google+
9 Replies


P: n/a
On Mar 21, 7:55*am, dom.k.bl...@googlemail.com wrote:
Can anyone recommend a good existing C++ coding standard - parctical,
pragmatic and sensible?

A company I joined recently are moving from C to C++, they are very
much into coding standards. But I have a horibble feeling they might
get a C programmer to write the C++ standard. Would be nice to be able
to suggest an existing standard.
No, but just a bit of advice to keep the "style" section to a
minimum. You can download and integrate a source code formatter (like
SourceFormatX) into your build stream that will format the code
according to your preference. Concentrate more on best practices. I
don't care what the name of the function is or where you put the curly
brace if it returns a dangling pointer.
Mar 21 '08 #2

P: n/a

wrote in message
Can anyone recommend a good existing C++ coding standard - parctical,
pragmatic and sensible?

A company I joined recently are moving from C to C++, they are very
much into coding standards. But I have a horibble feeling they might
get a C programmer to write the C++ standard. Would be nice to be able
to suggest an existing standard.
There is the book "C++ Coding Standards" by Sutter and Alexandrescu.
Mar 21 '08 #3

P: n/a
On Mar 21, 3:03 pm, "Maarten Kronenburg" <M.Kronenb...@inter.nl.net>
wrote:
wrote in message
Can anyone recommend a good existing C++ coding standard - parctical,
pragmatic and sensible?
A company I joined recently are moving from C to C++, they are very
much into coding standards. But I have a horibble feeling they might
get a C programmer to write the C++ standard. Would be nice to be able
to suggest an existing standard.

There is the book "C++ Coding Standards" by Sutter and Alexandrescu.
There was another book I heard of, 101 tips or something similar.

Are these worth investing in?
Mar 21 '08 #4

P: n/a
do*********@googlemail.com wrote:
Can anyone recommend a good existing C++ coding standard - parctical,
pragmatic and sensible?

A company I joined recently are moving from C to C++, they are very
much into coding standards. But I have a horibble feeling they might
get a C programmer to write the C++ standard. Would be nice to be able
to suggest an existing standard.
Hi,

Have a look at this chapter in the faq-lite.

http://www.parashift.com/c++-faq-lit...standards.html
Mar 21 '08 #5

P: n/a
In article <f6**********************************@i12g2000prf. googlegroups.com>,
<do*********@googlemail.comwrote:
>On Mar 21, 3:03 pm, "Maarten Kronenburg" <M.Kronenb...@inter.nl.net>
wrote:
> wrote in message
Can anyone recommend a good existing C++ coding standard - parctical,
pragmatic and sensible?
A company I joined recently are moving from C to C++, they are very
much into coding standards. But I have a horibble feeling they might
get a C programmer to write the C++ standard. Would be nice to be able
to suggest an existing standard.

There is the book "C++ Coding Standards" by Sutter and Alexandrescu.

There was another book I heard of, 101 tips or something similar.

Are these worth investing in?
IMO, you could do a lot worse than buying a copy of this
book. (Actually the company should buy the copy of the book for the
pricely sum of about 1 hours of developper time), read through it,
select the ones you agree with (hopefully most), delete the ones you
disagree, maybe ignore the ones that are irrelevant to your situation,
and publish your own standard built upon this solid base
adding your own favourite one for local flavour and placing the book
in the public company bookshelf for reference and longer explaination
of some guidelines.

Yan

Mar 25 '08 #6

P: n/a
do*********@googlemail.com wrote:
Can anyone recommend a good existing C++ coding standard - parctical,
pragmatic and sensible?

A company I joined recently are moving from C to C++, they are very
much into coding standards. But I have a horibble feeling they might
get a C programmer to write the C++ standard. Would be nice to be able
to suggest an existing standard.
The whole team should devise the coding standard.

I wrote one for my last company, but we dumped it in favour of what
ended up as a best practice page on our team wiki. Too many coding
standards go into way too much detail, with section on indentation,
brace placement and other trivia. Let the team decide as they share
code what works for them, if you have rules, make them editor or pretty
print ones that can be kept up to date.

--
Ian Collins.
Mar 26 '08 #7

P: n/a
On 3月26日, 下午12时28分, Ian Collins <ian-n...@hotmail.comwrote:
dom.k.bl...@googlemail.com wrote:
Can anyone recommend a good existing C++ coding standard - parctical,
pragmatic and sensible?
A company I joined recently are moving from C to C++, they are very
much into coding standards. But I have a horibble feeling they might
get a C programmer to write the C++ standard. Would be nice to be able
to suggest an existing standard.

The whole team should devise the coding standard.

I wrote one for my last company, but we dumped it in favour of what
ended up as a best practice page on our team wiki. Too many coding
standards go into way too much detail, with section on indentation,
brace placement and other trivia. Let the team decide as they share
code what works for them, if you have rules, make them editor or pretty
print ones that can be kept up to date.

--
Ian Collins.
The c++ Programming Languange
Mar 26 '08 #8

P: n/a
322322 wrote:
On 3月26日, 下午12时28分, Ian Collins <ian-n...@hotmail.comwrote:
>dom.k.bl...@googlemail.com wrote:
>>Can anyone recommend a good existing C++ coding standard - parctical,
pragmatic and sensible?
A company I joined recently are moving from C to C++, they are very
much into coding standards. But I have a horibble feeling they might
get a C programmer to write the C++ standard. Would be nice to be able
to suggest an existing standard.
The whole team should devise the coding standard.

I wrote one for my last company, but we dumped it in favour of what
ended up as a best practice page on our team wiki. Too many coding
standards go into way too much detail, with section on indentation,
brace placement and other trivia. Let the team decide as they share
code what works for them, if you have rules, make them editor or pretty
print ones that can be kept up to date.

The c++ Programming Languange
Is that a random utterance, or a comment?

--
Ian Collins.
Mar 26 '08 #9

P: n/a
Ian Collins wrote:
do*********@googlemail.com wrote:
Can anyone recommend a good existing C++ coding standard -
parctical, pragmatic and sensible?

A company I joined recently are moving from C to C++, they are very
much into coding standards. But I have a horibble feeling they might
get a C programmer to write the C++ standard. Would be nice to be
able to suggest an existing standard.

The whole team should devise the coding standard.

I wrote one for my last company, but we dumped it in favour of what
ended up as a best practice page on our team wiki.
Here, we had a group of representatives from the major projects using
C++ (inaptly named "The C++ Users Group) to work on the coding standard.
Too many coding
standards go into way too much detail, with section on indentation,
brace placement and other trivia. Let the team decide as they share
code what works for them, if you have rules, make them editor or
pretty print ones that can be kept up to date.
I strongly disagree with this. It's best to bite the bullet on those
things upfront, or it's a continual battle all through the project.


Brian
Mar 26 '08 #10

This discussion thread is closed

Replies have been disabled for this discussion.