Hacker News new | ask | show | jobs
by ebiester 3820 days ago
Incrementally fixing the "crappy" codebase is great in some cases: Michael Feathers's book on rescuing legacy code is fantastic. However, the limit comes at the language barrier.

Consider a COBOL codebase on a mainframe where you cannot find developers interested in learning the language and developing against the mainframe is convoluted -- you may not be able to pay talented people enough to toil in those coal mines, and you have to have to overpay subpar talent (or chase after the handful of expert mainframe COBOL developers.)

1 comments

You can incrementally rewrite, just like you can incrementally refactor. Stick an API gateway in front of your COBOL mainframe that responds the same way it does, and then stand up a new well-architected service, microservice by microservice, that has a good API—and have the API gateway query the new service (using its nice API) whenever clients make calls to what they think is the legacy service, passing whatever calls you haven't re-implemented yet through to the legacy service.

Eventually, everything will be on the new services, and you can shut down the legacy COBOL system and just keep the API gateway there to pretend. (If you can get clients switched over to consuming the new APIs directly, you can shut down the API gateway too—but good luck with that; their side probably has mainframes too.)

It's called the strangler pattern by many. (You probably know that, but our dear reader may want to follow up.)

It also assumes that you have a proper API to start. It assumes that you have the organizational maturity to handle synchronizing two separate systems and the distributed transactions that entails.

The other problem not mentioned in the rewrite/refactor conversation is that the most common reason for rewrites is that the business has backed itself into a corner and the assumptions under the first system do not apply to where the business wants to go.

"It assumes that you have the organizational maturity to handle synchronizing two separate systems and the distributed transactions that entails."

Well, to be honest, when we're talking about proper maintenance and advancement techniques, we must by definition be discussing the topic only for those with the discipline to correctly implement relevant techniques and policies. If your developers or management choose not to, be it for whatever reason up to and including total lack of requisite talent or experience somewhere, you've already lost and the only thing that can possibly save you is to address that problem first, and if that's not possible for whatever reason, you've simply already lost.

As a result, it turns out not to be an interesting case to discuss. Even if it is, probably, the dominant case in the field....

I think it makes the most interesting case. How do you level up an organization? It's a very hard problem that hasn't been solved yet.

In some markets, the talent to handle this type of project doesn't exist. In other markets, the cost to acquire that talent is more than the marginal cost of rewriting the system.