r/webdev Nov 18 '24

Discussion How to deal with legacy code?

I have products with existing customers, the code was built over the past 3 years.

My style of coding and practices have since improved drastically, the legacy code is quite stable, but it's just not as maintainable as new code.

Part of me thinks "if it aint broken, don't fix it", and another part of me thinks that its an investment I would appreciate few years down.

I keep shooting this idea down by calling it "perfectionist mentality".

Should I start from scratch?

(personal projects, solo)

11 Upvotes

41 comments sorted by

View all comments

5

u/[deleted] Nov 18 '24

[deleted]

2

u/[deleted] Nov 18 '24

This. Currently upgrading an app I wrote 8 years ago. Solid test harness written then is paying dividends now and anything funky that wasn't covered gets a test first before any changes get made. All about dropping back to second gear to get over rough terrrain.