DEV Community

Discussion on: How I can estimate the manhours that maintainance of a bad code costs?

Collapse
 
joelbonetr profile image
JoelBonetR 🥇 • Edited

Long story short it's always cheaper mantain it than coding from scratch in short term.
It depends on the size of the project, for a little project refactoring/rebuilding cost is cheap, for a huge project it could cost tones of money.
Also depends on the structure and "shape" the project has at this point.

The natural evolution should be:

  • monolithic app
  • isolate some app features as services, then connect them using some sort of bus event communication or api gateway.
  • isolate parts of the service for getting microservices.

Of course a microservice based application is cheaper to mantain (from the development point of view) but the infrastructure cost is relatively more expensive (also one or more server engineer is a must).

There are lots of applications that remain as a hybrid with some monolithic parts, some services and some microservices, with both bus event communication and api gateway, no matter the company. I read about all that from IBM engineers posts and i live it everyday.
I'm creating new apps microservice/service based but still mantaining a big legacy e-commerce; this maintenance tasks are some kinda living in the hell but... The business is not ready to start coding it from scratch. Even when i woke up and know that the day has come, it will not be a "we're starting to code it from scratch now", it will be more like "let's think which parts could we move into a service/microservice architecture and which technologies fits better to reach what business needs now, and what must need in a future", then start coding those parts while, obviously maintaining the legacy code. This process to rewrite all in a new shape could take up to 3 years with a 10 ppl team as least as we need to maintain all other software, solving the business needs and solving issues from current software while coding new one.

My advice is that, if you are a junior developer, forget about involving yourself in a crusade for the good code, last time i told a CTO that we need to start a project to write from scratch a 20+ year old app i almost was fired, even having 6 years of experience. The same CTO that didn't accept a JS + CSS refactor i did to solve issues with the app on not IE browsers and decrease the load time by 3 seconds...

I wasn't fired at this point but i left for a company with better people managing the teams 😅