| 1 | = Coding Tips = |
| 2 | |
| 3 | == Preprocessor defines, macros, inline functions == |
| 4 | |
| 5 | * Prefer using {{{enum}} instead of preprocessor defines for constants |
| 6 | * Preprocessor defines are only necessary when you are using the constant both in C and assembly sources |
| 7 | * Prefer using static inline functions instead of preprocessor macros |
| 8 | * Preprocessor macros are only needed (a) for type polymorphism, (b) if the result needs to be an l-value (R/W accessor) |
| 9 | * Prefer using regular functions to static inline functions |
| 10 | * Practically never needed, it is just premature optimization |