[gmx-developers] Re: gmx-developers Digest, Vol 96, Issue 17

Peter Kasson kasson at stanford.edu
Wed Apr 11 16:07:43 CEST 2012


> Date: Wed, 11 Apr 2012 15:50:25 +0200
> From: Szil?rd P?ll <szilard.pall at cbr.su.se>


> That's C++ and we're not there yet. For 4.6 IMO it makes sense to
> clarify code by replacing "x/10.0" with "x/A2NM". In fact, this will
> help with the transition to constants later.
>
> --
> Szilárd
>

I agree that a #define is better than just having the number 10
sitting in the code, though I think consts are better, and #defined
constants as Szilard uses above are better than macros that look like
functions (c.f. the Linux kernel style guide for C).  If we must do
this, I would suggest, however, that we use names that are slightly
longer, more suggestive of the purpose, and have fewer potential
namespace collisions with other libraries. :)

--Peter



More information about the gromacs.org_gmx-developers mailing list