← Back to context

Comment by blinkbat

5 days ago

serving the engineer _does_ serve the business, ultimately.

Not necessarily. I have seen it plenty of times where a new contributor/manager comes in, declares all existing code is crap and needs to be rewritten to their favorite language/framework/cloud provider.

A lot of rewrites could be avoided if people spent some time to actually understand what was done before. It’s a pretty safe assumption that the people who worked on the codebase before were as smart as you.

  • > It’s a pretty safe assumption that the people who worked on the codebase before were as smart as you.

    Amen! Code is never written in a vacuum. Code is never shaped only by engineering but by business and organizational compromises as well. I hate those guys who declare we absolutely must do sweeping changes to the codebase/architecture so that we are in line with the latest best practices after spending an hour with the codebase. As if the guys who spent the last 3+ years staring and building on said codebase didn't know any better (unless of course you were hired specifically because you ought to know better!).

    • "I hate those guys who declare we absolutely must do sweeping changes to the codebase/architecture so that we are in line with the latest best practices after spending an hour with the codebase."

      They also don't understand that their super shiny code will be legacy soon too.

  • > A lot of rewrites could be avoided if people spent some time to actually understand what was done before. It’s a pretty safe assumption that the people who worked on the codebase before were as smart as you.

    it’s not always a safe assumption.

    planned a full rewrite of a product at last company. i knew things were fucked 3 months in. i started really planning the rewrite 1.5 years in.

    that year taught me just how fucked it was: bugs galore, race conditions, crashing frontend, testing in customer environments, data loss, rolled their own security (users from any group could login to any other instance).

    previous big brained devs really fucked it and there wasn’t much of anything to show for it.

    i fixed a bunch of it. but it still needed a rewrite because they had built the wrong thing. which was the bigger issue i realised 3 months in.

  • > It’s a pretty safe assumption that the people who worked on the codebase before were as smart as you.

    The motivations and goals back then could have been different, specially in the case of MVPs

  • A friend of mine is migrating the company's IaC to TS as we speak because a new manager who recently joined the company decided to do it with no good reason.

This is my thinking as well. Although the 'never do full rewrites' rule is canon for most of the software world, I have led rewrites of two large front-end applications to great success - replacing an app that 'worked' but took an order of magnitude more time to iterate on than the codebase that replaced it.

That said, it's probably more dependent on what a 'full' rewrite actually is - I would be much more reluctant for a full-stack rewrite, particularly of a mature codebase with a lot of accumulated business logic. At least on the front end you can always push to move business logic upstream where it belongs.

  • I do feel like rewriting a front end that depends on the same backend is much less perilous than the alternative - in the end its basically just a presentation layer change

I think this is the key here. Most engineers go through some gradual phases from what I have learnt, initial, when they are confident of being able to accomplish everything, second when they feel they now understand how things work and third when they know that there is a lot more to it.

This essay sounds more like a second phase. Rewriting something that you do not understand makes sense if most people on team do not understand it well, and are supposed to actively contribute to it OR you are at an inflection point where the choice of architectural or foundational decisions made back then become a bottleneck in every day performance or feature development.

Business is looking it from the cost benefit perspective and they would not approve it at the cost of company time and money if it doesnt makes sense to them. Your ability to fool them for your motivations may be a different angle, still they are the ones making the call.

Iff the engineer's incentives are aligned with the businesses. Which is far from always true.

  • If so this is a problem on the business side, they're the one controlling a big part of the engineer's incentives

Came here to say this - you can construct a point to win this argument that needless rewrites are only for the engineer's satisfaction and serve no business need, but the article clearly argues against itself IMO. Rewriting to make it more ergonomic for developers to work with is ultimately going to be better for the business