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 is 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. When writing code for relax, please attempt to maintain the tradition by aiming towards a 25% comment ratio. The comment should be descriptive and explain the intent of the code below. The script scripts/code_validator can be used to check the comment density.



The relax user manual (PDF), created 2019-03-08.