Indentation

From $1

Table of contents

In order to properly comprehend code indentation is crucial. We recommend the following layout for all new code:

  • 4 spaces indentation for each function. If you are running out of screen space you should use this fancy new feature called "function"  ;-)
  • do not use tabs, spaces only - most editors can be set to generate spaces when you press the tab key!

This can be enforced by writing this comment as the first line in your source file (when using emacs).

/* -*- mode: c; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup"; -*- */

Then, after you inserted this, you return to the top of the file, press Ctrl-space, go to the bottom of the file and type Esc-x indent-region. Your source code file is now indented correctly according to GROMACS standards. It may be necessary to close and re-open the file, since emacs reads this magic comment only upon file opening.

Tags:
 
Comments (0)