Is there a good website, textbook, or other reference for coding practices which can help minimise errors? (No, I couldn't find an answer to this on stackoverflow, or through google searches)
I'm talking about ways to structure the code, rather than things like code reviews/unit testing/etc.
Example: Structuring an if test to place the CONST on the left of the logical expression. If the programmer accidentally types '=' rather than '==', a complation error will result:
if (CONST == variable) -> compile error if accidentally type '='
if (variable = CONST) -> not detected by complier, always evaluates to true
EDIT (re. accepted answer): "Code Complete" chapter 19 'General Control Issues' explicitly covers my example, and "Writing Sold Code" pg 4-5 talk about = vs ==.
Like anything, there are pros and cons. "Code Complete" does a good job of discussing these.