[gmx-developers] C++ code style / standards

Eric Irrgang ericirrgang at gmail.com
Mon Apr 8 14:54:19 CEST 2019


Hello Devs,

I was recently reminded again that GROMACS has a policy against using
C++ `namespace` for logical structuring of code within the GROMACS
package. I have never been able to find where that policy is expressed
or explained, so I created a Redmine issue to ask for that:
https://redmine.gromacs.org/issues/2919

I wanted to send an email to the list, though, to try to emphasize
that I hope a debate or lack-of-consensus will not get in the way of
clarifying current policy to improve code submission and review.

I would like to know why such a policy exists, though, and why/whether
symbol scoping of class members instead of namespace members would be
preferable (e.g.
https://redmine.gromacs.org/projects/gromacs/repository/revisions/master/entry/src/gromacs/tools/dump.h
represents the current convention), or under what circumstances
(templating, maybe?)

Thank you,
Eric

P.S. CppCoreGuidelines has either weak or amusingly incomplete
treatment of the topic:
http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rnr-lots-of-files
and http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rs-namespace


More information about the gromacs.org_gmx-developers mailing list