You inherited an old app. Now what?
October 6, 2026 · Rails
You fire up the application, press a single button and see an effect. Your next task is to trace back the origin of that effect. You discover there are 3.
My initial experience with a legacy app looked something like this. Our client would continue to add to the app, but it was fighting back.
A hodgepodge of JS frameworks
jQuery, vanilla JS, Stimulus: all were present, sometimes in combination across the app. There was an outdated release of Bootstrap and numerous bespoke overrides layered on top.
Equally chaotic were the views. As anyone who has worked with Rails will know, partials are a very powerful tool. But here we found partials nested within further nested partials, with associated helpers chaining through additional levels of helpers, often requiring 6-7 files to identify the source of a simple property. Frequently, that could have been addressed in a single file, 2 lines max.
There was no single culprit for this. Many developers contributed to the application throughout its lifetime, addressing their immediate concerns using the skills they had. Naturally, this led to multiple implementations of similar functionality.
However, we also had another consideration.
Legacy external dependencies
Our app depended on external services, and our dependency versions had fallen significantly behind. For some, these releases had reached EOL (end of life). This is significant, as the service will cease support for these endpoints and therefore any dependent calls will fail.
While legacy debt can often be deprioritized in favor of other work, once you know that certain sections of your website will fail if action isn't taken, the dynamic changes. Further, much of the functionality our customers requested was unavailable on our version of the external services.
So why didn't we start again?
Of course, the ideal situation would be to begin from scratch with a clean slate and a single JS stack.
But the lead time required to simply re-implement existing functionality would be substantial, delaying any improvements and of course failing to meet the external EOL timelines.
As such, we continued to run the existing platform and gradually improved it.
Document it all
The first step was to collate an inventory of the JS dependencies (including versions), Bootstrap and the external services being consumed, along with their equivalent current releases and EOL timelines.
Straightforward but highly beneficial. It allowed us to translate "we've got a lot of old tech" into specific items, some with associated dates. It also provided a good starting point to communicate the necessary remedial actions to non-developers.
Address the EOLs
We tackled the external service dependencies based on their EOL timeline, ensuring coverage and testing prior to progressing.
The remainder of the legacy debt was remediated opportunistically. At no point was the application at risk of degradation due to, for example, reliance on jQuery, so when developing against a given screen we took the opportunity to bring it in line with our target approach, converging on a consistent set of patterns.
We applied the same thinking to the views. Unnecessary levels of nesting were stripped away, and superfluous helper methods eliminated. Ultimately we wanted a new member of the team to be able to pick up a given view and quickly familiarize themselves with it.
By enforcing the use of the desired patterns for any new development, we ensured we didn't fall back into the habit of creating yet another variation.
Communicating the effort
Clearly, this is not immediately apparent to stakeholders once completed.
To overcome this, we highlighted the business benefits of each change, typically in relation to mitigating an imminent EOL or enabling the delivery of a specific request. With this messaging, we encountered little resistance, particularly given that a key senior stakeholder appreciated the requirement and advocated the activity.
Outcome
Most obviously, the website continued to operate following the removal of the legacy dependencies.
Additionally, we experienced fewer incidents and periods of degraded availability. Much of this had previously stemmed from failing legacy components and associated connectivity.
Going forward
Having learned from my experience, I would ensure that I documented the state of the application on arrival, rather than waiting for an external driver. Furthermore, I would flag the relevant EOL dates and plan accordingly. Depending on the length of the notice period, this may range from a multi-month program to an immediate priority.
Key takeaways from inheriting a legacy application
- Capture the current position
- Act on any drivers with an associated date
- Avoid a ground-up redevelopment; instead, remediate iteratively
- Apply the improved practice to all subsequent development
- Sell the activity based on its positive impact
Generally, applications become legacy as a result of having fulfilled their purpose. They merely require continued stewardship.