We can all agree that bringing old projects back to life is never easy. So when you’re archiving a project, think of your future self and leave some exploding breadcrumbs.
In the traditional metaphor of leaving yourself breadcrumbs in a maze, when you want to find your way back, you simply follow the breadcrumbs. We can do even better: exploding breadcrumbs. These are hints to yourself that you cannot ignore. With exploding breadcrumbs, the legacy project will force you to take proper steps and protect yourself.
Example #1: Language Runtime Version
Last month, I needed to work on a 10-year-old Ruby desktop application. I grabbed the repository, went into the project directory, and ran rake -T
to see what would happen.
Due to its age, this project requires Ruby 1.8. I was using 2.4 when I ran the command.
Thankfully, a breadcrumb exploded in my face by doing two things:
- It helpfully told me, “You seem not to be using Ruby 1.8. This Rakefile was written for Ruby 1.8 and will operate incorrectly with anything higher.”
- It immediately halted execution.
I’m glad it stopped! If I’m lucky, newer versions of Ruby may work–by coincidence. But this project is clearly tied closely to Ruby 1.8, and I’m glad it told me.
Example #2: Automated Spreadsheet Updates
I have another script that automatically inserts billing information into a separate spreadsheet tracking hours and budget.
Once every other month, I need to add a new row for a purchase order tracking number. This changes the row offset for my hours data. My script definitely needs to be updated, and if it isn’t, it might clobber data. Ick.
There’s an exploding breadcrumb for that! The script looks at the spreadsheet content and asserts that some header content is present. If not, it prints a message and exits.
I love this for two reasons :
- The script exits instead of clobbering old data.
- Even better, it prints out a message telling me exactly what to do next.
Remember Your Future Self
When that urgent support request comes in seven years from now, the last thing you want to be dealing with are Ruby runtime versions or spreadsheet headers. Take some time now to leave some exploding breadcrumbs.
Your future self will love you for it.