Use descriptive variable and function names.
Divide large functions into sub-functions to group together statements that belong to each other, this can be useful for reusing code.
Try to keep the functions as flat as possible and embed the nested functions in separate functions, so each nesting level can get its own descriptive name for the function.
I try to avoid nesting multiple ifs for the same function. If you have any, if with large parts, try reorganizing the parts into your own functions. Thus, if it will be much easier to understand, and any explanation may be in the names of true / false functions.
Not always converted to linq, large linq instructions are often more difficult to read than a regular loop with if constructs and possible variables.
Use variables for temporary data instead of wrapping statements around statements. This improves readability, gives you the ability to name temporary vars for explanation, and also simplifies debugging, since the string will precisely determine the operator, not the collection o of nested statements.
There is a pretty good book that I read about it, entitled "Clean Code" from Prentice Hall, which is much deeper in that.
source share