Comments

Comments are a very important component within relax. In the current source code the percentage of comment lines relative to lines of code ranges from 15% to over 30% for different files. The average comment density would be close to 25%. The purpose of having so many comment lines, much more than you would expect from source code, is so that the relax's code is fully self documented. It allows someone who is not familiar with the codebase to read the code and quickly understand what is happening. It simplifies the process of learning and allows NMR spectroscopists who are not coders to dive into the code. If writing code for relax, please attempt to maintain the tradition by aiming towards a 25% comment ratio. The comment should be descriptive of what the code below it is supposed to do. Most importantly the comment explains why that code exists. The script scripts/code_validator can be used to check the comment density.

The relax user manual (PDF), created 2016-10-28.