Principles and Techniques to Write More Durable Code

session

Thursday, May 16th, 10:15

A college professor of mine would start every class with "Software development is hard. Really hard." Thankfully, coding principles can help us simplify hard programming decisions. Taking a "principled" approach to development will allow us to humbly architect new solutions or improve existing systems while avoiding the pitfalls of endlessly rewriting others (or our own) code.

  • Avoid Clever Code - Brian Kernighan “Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.”
  • Inversion of control.
  • Composition over inheritance.
  • Self-documenting code.
  • Encapsulation / Tell, Don't Ask.
  • Reduce nesting.
  • Avoid reassignment.
  • Guard statements.

The presentation will consist of code examples that are refactored live according to each of the above principles.

Level

All

Speaker