Re: CERT C++ Programming Language Secure Coding Standard
Beman Dawes wrote:
Fred Long wrote:
The CERT/CC has just deployed a new web site dedicated to
developing secure coding standards for the C programming
language, C++, and eventually other programming language.
We have already developed significant content for the C++
programming language that is available at:
https://www.securecoding.cert.org/
by clicking on the link:
"CERT C++ Programming Language Secure Coding Standard"
Naive imperative coding standards like these do a disservice
to programmers.
I would agree here only if I found the coding guidelines in
question naive. (That was my first impression, but I haven't
studied it enough to make any real judgement.) In critical code,
some imperative coding standard is almost a necessity (not that
it guarantees correct code, but it can greatly improve the
chances that incorrect code is identified in code reviews and
such).
In the real world, few coding practices apply to every case.
There are always special cases that need to be handled
differently.
The coding standard in question isn't meant to apply to every
case. At least I don't think so. Critical code does have
special requirements, which aren't necessarily applicable in
general.
For example, MSC00-A, Declare data members private, fails to
mention any cases where the guideline doesn't apply. Yet
Sutter and Alexandrescu in their well-considered "C++ Coding
Standards", list value aggregates and testing code as two
cases where such information hiding isn't applicable.
This particular coding standard wouldn't apply to testing code,
so that exception isn't relevant. And I can see some
justification for not accepting value aggregates in critical
code; accessor functions provide convenient control points.
(Obviously, such a rule should be accompanied by a rule saying
that every setter must validate the new value. If not, there's
no point in making the data private.)
--
James Kanze GABI Software
Conseils en informatique orient9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S9mard, 78210 St.-Cyr-l'cole, France, +33 (0)1 30 23 00 34
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]