variable names must only contain english words
count instead of element_count)exception: single-letter variable names are acceptable and even preferred if structure dominates over data in very small scopes.
(map (lambda (a) (+ 1 a))). especially when the same mapping function is used in multiple contexts, then it may not matter what "a" is, only what happens to it.strict call by contract
purely functional terms can be seen a canonical encoding that can be projected upwards into imperative, object-oriented, or state-based implementations, and not equivalently reversed.
if (a) {b} else {c} over if (!a) {c} else {b}'x == 0 and simply use ! in ctests can be split into two categories: basic and detailed.
basic tests test minimal calls and compositions. compile errors, type signature changes, raised exceptions, and segfaults become immediately obvious. after changes, there tend to be many unknowns about the required adjustment effort. it is helpful to know early that the code still runs on this basic level. intricate changes in the content of the calculations dont affect a lot of code of these tests, which makes them easier to maintain. it is easier to make this layer of tests work after changes, before focusing on more specific input and assertions. assertions are only added to the data flow, never adding to or otherwise influencing the rest of the basic test code.
detailed tests test finer assumptions about the processed data. these tests build on a systems where the basics already work. not mixing it in with the basic tests keeps things simple and separable.
this separation is also more suitable for automated refactoring, which can focus on the detailed test schemes and use examples from the updated minimal call api.
single-compilation units
declare and define all variables at the beginning of each function before usage
-- or ++; use explicit arithmetic insteadNULL, as the macro increases complexity without adding any expressive power beyond 0while(1) instead of for(;;)suckless software written with simplicity in mind