| 260 | |
| 261 | === Don't use #define for const values === #code-good-bad-const-defines |
| 262 | |
| 263 | Creating constant variables as |
| 264 | {{{ |
| 265 | #define three 3. |
| 266 | }}} |
| 267 | is evil because: |
| 268 | * in the debugger you only see ''3.'' not ''three''. Hence, you have significantly less information and a harder time to understand the code. |
| 269 | * very strange errors may occur of a define is used as an argument in another define. |
| 270 | |
| 271 | Instead use: |
| 272 | * '''Enum-Hack:''' enum {Num = 2}; for integers, used very frequently in the context of Template Meta Programming |
| 273 | * '''Const variables''' simply declare a (even global) const variable to contain the value. |
| 274 | |