[gmx-developers] GROMACS C++ coding style

Mark Abraham mark.j.abraham at gmail.com
Thu Feb 21 12:21:15 CET 2013


I think editor configuration is the responsibility of the user of the
editor, and not the business of the code being edited. I'm happy if we put
up some guidelines somewhere for how to configure editors (e.g. as we do
now http://www.gromacs.org/Developer_Zone/Programming_Guide/Code_Formatting,
though this will need some work still), but having yet more things in the
source code to keep up to date is a pain.

Mark

On Thu, Feb 21, 2013 at 10:39 AM, Berk Hess <hess at kth.se> wrote:

> On 02/21/2013 10:17 AM, David van der Spoel wrote:
>
>> On 2013-02-20 22:52, Mark Abraham wrote:
>>
>>> Hi devs,
>>>
>>> It occurred to some of us today that we should pick a C++ coding style
>>> now before things advance too far. Berk, Teemu and Mark in
>>> http://redmine.gromacs.org/**issues/845<http://redmine.gromacs.org/issues/845>got as far as agreeing that they
>>> don't care too much about a particular style, except that it should use
>>> spacing that enhances code readability, and be readily supported in
>>> common editors (emacs, vi, Eclipse, anything else?). Ideally, without
>>> needing custom configuration of such editors.
>>>
>>> Is there anyone who already has a good reason for supporting / vetoing
>>> particular styles?
>>>
>>> Also, any remaining emacs magic lines will disappear at some point soon.
>>>
>>> Mark
>>>
>>>
>>>  This is indeed useful. However it would be immensely helpful to have
>> something like emacs magic lines to help maintain a certain style. If these
>> are to disappear, HOW will it be enforced? I noted e.g. that a lot of
>> Teemu's code has a "non-standard" indentation where
>> namespace gmx {
>>
>> does not cause indentation of the underlying code (e.g. class
>> definitions). I don't mind this, but if such an indentation pattern can not
>> be automated it will be difficult to keep it.
>>
>>  Anything can be automated in emacs.
> M-x c-set-style stroustrup
> gets things about right for C code, except that this does not match the
> "case" indentation of uncrustify.
> I would guess it should be quite close as well for C++.
> We can easily customize the emacs settings, and put in on the wiki, or
> change our standard.
> I don't mind have the Gromacs style default for C++ in my emacs.
>
> Cheers,
>
> Berk
>
>
> --
> gmx-developers mailing list
> gmx-developers at gromacs.org
> http://lists.gromacs.org/**mailman/listinfo/gmx-**developers<http://lists.gromacs.org/mailman/listinfo/gmx-developers>
> Please don't post (un)subscribe requests to the list. Use the www
> interface or send it to gmx-developers-request@**gromacs.org<gmx-developers-request at gromacs.org>
> .
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20130221/76579fdf/attachment.html>


More information about the gromacs.org_gmx-developers mailing list