Programming styles: Feedback
Posted by Gilbert Peffer on Dec 20, 2000; 10:58am
URL: http://quantlib.414.s1.nabble.com/Programming-styles-Feedback-tp1634.html
Hi there,
I have read through the C++ Programming Style Guidelines, and thought that,
with a few exceptions (in addition to those posted by Luigi yesterday), all
the rules were acceptable. The ones where I have some comments are:
22. I often call variable or object containers <set>, although for a
mathematical purist, this can provoke considerable grief
24. I usually use <num>, but <no> is as good. One may as well permit both
36. This is currently in contradiction to some of the code in Quantlib. I
myself are not too consistent in this particular style case. What do you
think?
38. ...TABs should be avoided. Does anybody have an idea of the real impact
the use of TABs can have?
69. I prefer 4 spaces
73. I prefer the SUN recommendation, but this has no big impact anyway, I
think
87. I would like to add a suggestion for function/subroutine definitions.
For long argument lists (and for short ones as well), I prefer to stack the
arguments
runThisRoutine (int numNodes, // Number of nodes
int numElements, // Number of elements
double* coordinateSet, // Nodal coordinates
int* connectivityList) { // Elements connectivites
blah blah
}
so one can comment each of the arguments individually. Unless somebody has a
strong objection about this (I guess it is a style choice one has to get
used to) I wouldn't mind seeing it implemented in Quantlib
That's about it. Please send me your suggestions so I can put a draft
together
Best regards
Gilbert