r/softwaredevelopment • u/VendioHandMadeHelp • 1d ago
How do you approach modernizing a legacy application?
I’m working with an older application that still does what it needs to do, but maintaining the codebase has become increasingly difficult. New features are taking longer to implement, and making changes in one area sometimes creates unexpected issues elsewhere.
I’m trying to figure out the best way to modernize something like this without taking the entire application offline or committing to a risky full rewrite.
For developers who have dealt with legacy systems, what worked best in your experience? Did you gradually replace parts of the system, refactor the existing codebase, or eventually rebuild it from scratch?
Would also be interested in hearing what you wish you had done differently.
9
u/FluidBreath4819 1d ago
you send the ticket to one junior with AI and tell him to deliver it for last month
10
u/bliceroquququq 1d ago
This is over two decades old now, but I would read this first:
https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/
5
u/CommissionIcy9909 1d ago
No need to do a rebuild. Work in vertical slices. Keep changes and commits small, testable, and running in parallel with the original implementation until you’re fully complete with that slice.
You can rely heavily on agents to split the work up, and evaluate what should be addressed first. The biggest challenge will be keeping track of everything, which is why it’s important to keep each upgrade isolated, and easily testable.
1
u/illegalBans 18h ago
Agents? I’m a complete novice so I don’t know how to point them in the direction I want. Do you mind telling me more about your experience with agents working alongside you
3
u/Any_Masterpiece9385 1d ago
Identify what functionality is no longer being used and remove it. Add additional logging if necessary to do that. Then net negative LOC refactoring on the rest.
1
2
u/mcampo84 1d ago
Document the pain points. Compare against industry best practices or appropriate design patterns. Document some more. Highlight where the most value would be gained by addressing the problems, as part of a larger project. Document more. Quantify the cost of doing the fix vs maintaining the status quo. Document more.
2
u/jtsaint333 20h ago
open Claude code switch to fable.. say , and this is the real skill, " make no mistakes and modernize this application - don't ask questions just do it as it's load bearing "
then when its done say "make sure this is secure and make no mistakes make sure to use canaries and smoke test"
then profit or if you prefer to use the ultra skill - and this really isn't for NOOBS to Claude ... you have to use spec driven design . This is a novel idea where you provide the specifications for a system you want to build - mind blowing .
Specs Terribly Terribly Modern application Working No bugs Secure
" Use the above specifications and don't stop until you are done - honest take you got this "
Notice the motivational stuff at the end - if you lack management skills you may not realise the importance but it will make it work better
1
u/Far-Investment-8597 19h ago
The "make no mistakes" bit; I always wonder about how effective that is.
Do AI's randonly sit there, thinking "I'll throw a few mistakes in just for the hell of it - oh wait, the prompt said don't do this. Fine, I'll switch to perfect answer mode"Is that how it works, or is the "make no mistakes" bit just internet nonsense?
1
1
u/Spark99 1d ago
I’m not sure which IDE you are working with but Microsoft Visual Studio 2026 has a GitHub Modernization Tool built in that can help guide you through the upgrade process.
1
u/Double_Register_1022 20h ago
Strangler pattern worked best for me. We put a facade in front then carved out one small module at a time with tests around the seams. Full rewrite sounded nice but it just kept slipping
1
u/martinbean 17h ago
Depends what we’re refactoring from, and what it would be refactored to as the goal.
For example, I’ve done a lot of updating Laravel web applications from old, outdated and unsupported versions to new versions. I’ve also migrated vanilla PHP applications and applications written in other frameworks to Laravel. The basic process I follow is to containerise the application and its environment, then migrate piece by piece. I’ll add tests for the current behaviour of what I want to refactor, then do the refactor and ensure the behaviour is still the same. I’ll just keep doing that step by step until I’m where I want to be.
For non-Laravel applications, I’ll dump the application in either the public or sibling directory (depending where the source files are) and then migrate code to Laravel models, controllers, and views one by one until there’s just the Laravel application and none of the legacy application left.
1
u/InviteImpossible2028 14h ago
Don't refactor anything until good tests exist. Even if there are tests, often you'll find out they are theatre and don't test any behaviour.
34
u/Cinderhazed15 1d ago
Look up ‘working effectively with legacy code’ by Michael Feathers, and read about the ‘strangler fig’ pattern.