0

I'm working on medium sized ASP.NET MVC 4 web app, that is about 2.5 years old. Around 25-30k lines of code. The project has never followed any of the good .NET design practices. It is a very tightly coupled solution. There are not interfaces at all.

Do you think it is worth to upgrade the legacy/spaghetti code to follow SOLID principles and implement some design patterns? I know there is quite a good book to work with legacy code (don't remember the actual name).

The problem is that the project is constantly growing and the cost of refactoring is also growing every time new functionality is added. I wanted to spend some time to upgrade it, but when I looked into details of doing so, it overwhelmed me. There is so many changes needed that I don't know where to start with.

Has anyone got any experience with upgrading the legacy code? Was it worth it to spend so much time on it? Any ideas where to start?

gnat
  • 21,213
  • 29
  • 113
  • 291
Grentley
  • 125

1 Answers1

0

Everything depends on how long is this project meant to last. In addition, you need to ask yourself one important question - if you are working in a team, is your team capable of writing a better quality code than the current one?

When it comes to time:

Just a few more weeks

Any kind of rewrite don't really makes much sense at this scale - when a new feature is needed or there is a bug to fix, simply expand existing code.

Few months

At this scale, you could consider rewrite of parts of code that are actively developed and using good practices in the code written in a future, but the whole code rewrite will most likely take too much time to be worth it.

Year or more

If the project is meant to last for a very long time, I think that total rewrite could be a good idea. Rewriting the program to use good practices should take much less time than it took to write it initially (but this will still take a considerable amount of time).

Mac70
  • 356