ringbuffer_extend() for adding extra space to the last added entry
[nobug.git] / doc / bestpractices.txt
blob3e8c8381a35ed2ee381bb7a31b6f583c74f74724
1 Best Practices
2 --------------
4 NOTE: this section is very work in progress
6 PARA Workflow;;
8  1. Development
9       * Write a testsuite, build your program with -O0 -g -DEBUG_ALPHA and run
10         the testsuite under valgrind control. Hack until the program mets the
11         specifications defined by the testsuite.
12  2. Beta Test
13       * Build with desired optimization level and -g -DEBUG_BETA and give the
14         program to your beta testers.
15  3. Release
16       * Build it with optimization and without -g -DEBUG_*
18 PARA What and when to check;;
20   * Add REQUIRE checks on your interfaces (incoming parameters). Especially if
21     a argument might not cover the whole range of the underlying type.
22   * Don't waste your and your CPU's time with unnecessary checks. The testsuite
23     should validate your program. NoBug aids in debugging. You can add
24     Postconditions (ENSURE) and Invariants when you have a bug somewhere and
25     want to nail it down.
26   * Added checks don't need to be removed.
27   * When you use the CHECKED/UNCHECKED features then don't forget C scoping
28     rules, tag things as CHECKED from the leaves to the root.
30 PARA Tips & Tricks;;
32   * TRACE(flagname) at the begin of every nontrivial function will easily log
33     the progress of your application.
34   * Trying a RELEASE build will abort on certain conditions (known BUG, TODO's,
35     UNCHECKED code), you can use this to find these spots.