Boost logo

Boost Users :

Subject: Re: [Boost-users] C++ and quality of software
From: Marshall Clow (mclow.lists_at_[hidden])
Date: 2010-01-25 16:28:47


On Jan 25, 2010, at 1:18 PM, Bo Jensen wrote:
> On Mon, Jan 25, 2010 at 9:58 PM, Peter Foelsche <foelsche_at_[hidden]> wrote:
>> I was thinking. There should be some C++ software quality assurance
>> institution. They would give a stamp of approval to software written in C++.
>> Criteria would be:
>> a.. no usage fixed-sized buffers
>> b.. no usage of functions from the c library, which do not check for
>> correct type, like *printf(), *scanf().
>> c.. no dangling resources, no resource leaks in any case
>> d.. usage of C++ Exception Handling for reporting errors (all fallible
>> OS-calls are wrapped into C++, this can be checked by denying read/write
>> permissions on some object, the software is trying to read/write to)
>> e.. clean design -- e.g. no protocols (no protocols is my way of saying,
>> that all methods of classes can be used and make sense to be used, as soon
>> as this object exists)
>> What do you think?
>> I also published this on my blog:
>> http://foelsche.spaces.live.com/blog/cns!2BFA22F3AB9E833!921.entry
>
> Google has some effort in that direction :
>
> http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
>
> http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py
>

Yes they do. It includes nuggets like this:
<http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Exceptions>

Smart Pointers
â–¶ If you actually need pointer semantics, scoped_ptr is great. You should only use std::tr1::shared_ptr under very specific conditions, such as when objects need to be held by STL containers. You should never use auto_ptr.

Reference Arguments
â–¶ All parameters passed by reference must be labeled const.

Default Arguments
â–¶ We do not allow default function parameters, except in a few uncommon situations explained below.

Exceptions
â–¶ We do not use C++ exceptions.

Run-Time Type Information (RTTI)
â–¶ We do not use Run Time Type Information (RTTI).

-- Marshall


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net