Does this code spark joy? Tidying up your code bit by bit

  • Messy code can result in bugs, prolonged development time, or increased difficulty with onboarding new engineers.
  • Tidying means making purely structural changes to a confusing and messy section of code.
  • Use helper methods and differentiate between sections of code that are accomplishing different tasks.
  • Ensure your tests pass at all times when making changes.

“Divide your program into methods that perform one identifiable task. Keep all of the operations in a method at the same level of abstraction.” - Kent Beck

Full post here, 5 mins read