Re: Coding Practice Guidelines
Posted by
Luigi Ballabio-3 on
Jan 24, 2001; 2:42pm
URL: http://quantlib.414.s1.nabble.com/Coding-Practice-Guidelines-tp1680p1682.html
At 12:39 PM 1/24/01 +0100, Gilbert Peffer wrote:
>Beside the coding style guidelines, Jacob Dreyer from Geotechnical Software
>Services has started writing C++ coding practice guidelines. You can find
>them in
http://geosoft.no/cpp.html.
>
>His comment was that these guidlines are not yet finished and suggested that
>one could finish this in a joint effort. The guidelines are mostly based on
>Meyers.
>
>What are your thoughts on this?
I had a look at the thing and I agree with the recommendations - I actually
use them already, which wasn't true for the previous batch :)
The only thing I would correct is the "must" in
28. A public member function must never return a non-const reference or
pointer to member data
which doesn't take into account members like Array::operator[](int).
While the above might violate encapsulation as argued,
a[4] = 3.5
is _much_ clearer than
a.setElement(4,3.5)
or whatever other name you give it.
Bye,
Luigi