How To Train Your Dragon: Working with legacy code

By Glenn Sarti

Elevator Pitch

We all have “one of those” PowerShell projects.; The one we wrote a while ago that we want to fix but it’s too hard and every change just breaks stuff. Legacy, it’s a thing. In this talk we’ll look at techniques to help bring your legacy codebase under control, and avoid falling into disrepair.

Description

We all have “that” PowerShell project. You know, the one we wrote a while ago that we want to fix or make better, but it’s to hard to do and every new thing just breaks stuff. Legacy, it’s a thing (tm). In this talk we’ll discuss techniques to help bring your legacy codebase into a manageable state, and how to avoid letting your project fall into disrepair(?) in the future.

Topics:

What is legacy code?

  • What does it mean in this talk?

Why is it a problem?

  • Hard to make changes
  • Difficult to understand and explain
  • So, how about an example…

What Techniques can I use?

  • Tests
  • Wrapping
  • Changes to make it testable

Demo - Practical examples

So now it’s migrated and not legacy, now what?

  • Tips on how to keep it that way

There will also be references for further reading.

Notes

I’m sure everyone at PS Summit knows of, or has even created, a PowerShell project that is hard to maintain or understand. Working with legacy code is difficult but it’s not impossible. In fact some people even enjoy it! In this talk I want to show people that while on the first look it’s too hard to wrangle old codebases, there are techniques that can be used to help you. Also by doing this now, you will save yourself time later on; Slowing down, to go faster.

Also these techniques are not PowerShell specific and can be used on many other languages.