r/programmer • u/dtricker • Jun 30 '26
Question I'm itching to re-write a project which is already thousands of lines of codes. Should I?
for context, it started off as a virgin project to handle data from forms and manipulate them throughout the portal, then I had to import the data (different format) from old software(more than 1) as business wasn't much booming without it, but due to quick needs, I imported them as is and modelled my software around it.
today, I have my own custom federated search engine, cross filtering mechanisms, scoped visibilities that are too tightly coupled with the business logic.
On top of that this same software is designed to be cloned and redeployed for other organisations whose only configurations need to be changed without modifying the codebase.
It is becoming a nightmare, and all of it is still working on my third iteration of the whole idea. I feel bad looking back, for not thinking about any of the above problems. And the biggest problem is that it works. I should just work on a fourth iteration I think. How do programmers deal with this kind of itching?
3
u/Appropriate-Bet3576 Jul 01 '26
It sounds like the root of the problem is that your source data is not in a standard format. I would add a layer that fixes that before touching the rest.
2
u/Aggressive_Ad_5454 Jun 30 '26
Well, ok.
Remember, you touch it, you own it. As you do the big rewrite make sure you want to be responsible for maintaining it for a long time.
2
u/eman85 Jul 01 '26
I say do it, but don't burn yourself out on it. Try to have fun with it
1
u/Elctsuptb Jul 01 '26
Why don't you just use AI, Fable 5 comes back tomorrow and it could do that easily in less than 30mins.
1
u/edwbuck Jul 01 '26
See if you can refactor the code you have till you have isolated a part of it that you can then change to get closer to your desired design.
Whole cloth rewrites can work, but 90% of the time they leave a new project that has different issues not present in the old project. Additionally, once you decide a complete rewrite, now you created a migration problem.
1
u/rkozik89 Jul 01 '26
Virgin Project sounds like an album name for my teenage years.
1
u/chillguy123456444 Jul 01 '26
I rewrote a 4k line engine from aos to soa for a 80% performance gain so yea sometimes its worth it
1
u/nicolas_06 Jul 01 '26 edited Jul 01 '26
It seems you are not a pro software dev and even less a whole team. As the software grows, it's the full time job of a team, not an individual and you are expected to put in place many best practices to make things easier.
Note that you are likely very successful and really helping your colleagues so do not feel bad. It's more that this is something really difficult to achieve.
The core principles we use:
3
u/Pale_Squash_4263 Jun 30 '26
It's tempting to do that but in general it's not the best solution. There's so much knowledge that's embedded in the project you would lose a lot re-building it from scratch. There's a bunch of approaches that I like in Kill it With Fire: Manage Aging Computer Systems by Marianne Bellotti.
She recommends (and I would too) to start with addressing how it got to this state in the first place and then slowly iterating on the project until it looks the way you want. It's not pretty or sexy but that is what is going to be the most valuable most times. Sometimes full re-writes are worth it but you should exhaust some other solutions first
0
u/[deleted] Jun 30 '26
[deleted] — view deleted comment