eba5f7af55ede63bdd76fd69e15d1c76f64e07d9 kent Fri Apr 13 11:50:42 2012 -0700 Remembered we need real tabs for the makefiles. diff --git src/README src/README index 68e614f..550ec9a 100644 --- src/README +++ src/README @@ -57,36 +57,38 @@ INDENTATION AND SPACING: The code follows an indentation convention that is a bit unusual for C. Opening and closing braces are on a line by themselves and are indented at the same level as the block they enclose: if (someTest) { doSomething(); doSomethingElse(); } Each block of code is indented by 4 from the previous block. As per Unix standard practice, tab stops are set to 8, not 4 as is the common practice in Windows, so some care must be -taken when using tabs for indenting. Since tabs are especially -problematic for Python code, and we are starting to use -Python a fair bit as well, tabs are best avoided altogether. -The proper settings for the vi editor to interpret tabs correctly -in existing code, and avoid tabs in new code are: - set ts=8 set sw=4 set expandtab +taken when using tabs for indenting. + +Tabs continue to be a problem for the programmer even in 2012. +Currently our makefiles require tabs, while our python code forbids +them. The C code can go either way so long as tabs are treated +as advancing to the next multiple-of-eight column. Please consult local +users of your favorite editor for help configuring it with these +indentation and tab standards. Lines should be no more than 100 characters wide. Lines that are longer than this are broken and indented at least 8 spaces more than the original line to indicate the line continuation. Where possible simplifying techniques should be applied to the code in preference to using line continuations, since line continuations obscure the logic conveyed in the indentation of the program. Line continuations may be unavoidable when calling functions with long parameter lists. In most other situations lines can be shortened in better ways than line continuations. Complex expressions can be broken into parts that are assigned to intermediate variables. Long variable names can be revisited and sometimes shortened. Deep indenting can be avoided by simplifying logic and by moving blocks into their own functions. These are just some ways of avoiding long lines.