#RemotePairProgramming Ep 008: Adi & Tom – Improving Legacy Code

The book Facilitating Technical Events is for technical trainers, coaches, events organizers who want to have a good event flow and happy attendees.
Support independent publishing: Buy this e-book on Lulu.

About

After episode 7 when we added the minimum amount of tests needed to start refactoring legacy code, you can see how we gradually improve the code in small steps.

 

We start with running coverage on the code base. The next step is to touch only the lines that are covered by tests.

We apply refactoring like: extract method, rename, minimize duplication, extract class, and all with plenty of commits on our local git repository.

Also a couple of times we switch the keyboard with remote pairing.

Our debrief:

  • Interesting to get back to this code base, even after having recorded a code cast on this problem
  • It is always fun to work on legacy code
  • Great to extract methods from inside-out and then spot duplication between the extracted methods
  • The tests helped a lot
  • You always learn some small or bigger things when pairing
  • Extract methods from inside-out is my default way of understanding the code
  • I even extract inside-out my own code after a few years to understand what my code does
  • IntelliJ is very powerful to spot duplication
  • You can win hours per day just by using IntelliJ right
  • Nice to use the language in a deeper way
  • When I don’t know where I’m going I go in incredibly small steps, when I know where I’m going I go in bigger steps
  • The tooling for remote pairing is usable, you can get much more efficient with it, but it’s still clunky
  • Configurations are different on different IDEs, and they are adding noise on the code base we work. I prefer working in only one environment
  • The opportunity to switch when pairing remote is not that fast as working side-by-side
  • There is an added latency when pairing remote, and it’s a cost we pay when we do remote pairing

 

Check the video and have fun applying this:

Video

Acknowledgements

Many thanks to Tom for taking the time to record this codecast with me.

What’s Next?

Check the previous episodes of #RemotePairProgramming:

 

Subscribe

If you want to receive an email when I write a new article, subscribe here:

Subscribe for new articles

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Subscribe for new articles