The Cost of Unmaintainable Code
Technical debt compounds. Code that's hard to change slows down every future feature and every bug fix.
Naming Things Well
Variables and functions should explain what they do. calculateOrderTotal() is better than calc(). Spend time on names.
Small Functions
Functions should do one thing. If you can't describe what a function does without using "and", it should be split.
Tests as Documentation
Well-written tests document the expected behavior of your code better than any comment.
Resist Premature Abstraction
Three similar lines of code is better than a premature abstraction. Wait until you see the pattern clearly before extracting it.