
On Jan 25, 2010, at 1:18 PM, Bo Jensen wrote:
On Mon, Jan 25, 2010 at 9:58 PM, Peter Foelsche
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