I found myself needing to keep around some tenets of extreme programming just to occasionally remind myself. I’ve never taken to the entirety of XP since it requires a lot of different people all doing things the same way. Since that never happens, I’ve tried to pick out the parts that are more universally applicable. Turns out we really like our acronyms.
Coding Principles #
YAGNI – You Aren’t Gonna Need It
Don’t waste time building something that’s unnecessary. Not every method needs verbose error handling or logging.
KISS – Keep It Simple, Stupid
Keep code clean and simple. Avoid adding complexity.
DRY – Don’t Repeat Yourself
If you’re doing something more than once, extract it into a single place where you can refer to it. Combines nicely with:
SPOT – Single Point Of Truth
Don’t have the same constants in multiple places. Don’t have multiple ways to do the same thing (e.g., tie multiple interfaces into a single endpoint).
Practices #
Test Driven Development – Red-Green-Refactor
Write the tests first, then implement to pass the test.
Continuous Integration
Always be integrating. Continuous testing and deployment are critical to make sure the codebase stays in a consistent, high-quality, and stable state.
Sustainable Pace
Simply put: don’t work more than 40 hours/week. Well-rested people perform best. Development cycles should be short and frequent – there should never be a “crunch” time. Code should be high-quality, thoroughly tested, and always executable (the main branch is always in a “good” state). Developers should never be committed to more work than is reasonable and attainable.
Respect
Developers should respect each other as well as themselves. Respect the team by never committing changes that break compilation, make existing tests fail, or otherwise delay work. Respect yourself by always striving for high quality and the best solution for the problem at hand.