Live data from Hacker News

Ask HN: Inherited the worst code and tech team I have ever seen. How to fix it?

news.ycombinator.com

501–510 of 704 posts

Re: Ask HN: Inherited the worst code and tech team I have ever seen. How to fix it?

#501
post #66

Earlier quoted context omitted.

The problem with people new to the company starting a rewrite from scratch is that they often are poorly informed on why things were the way they were before. If you start big, you can have bad outcomes where the new system might be objectively worse than the old one... but you are stuck trying to get the new thing out for the next 5 years because too many people sunk too much political capital into it. As an example…

You're making a silent assumption that the original team is well informed about why the things are like they are and that they know what they are doing. I think it is not always the case. I've been to a project once where the mess in the original system was the result of the original team not knowing what they were doing and just doing permutation based programming - applying random changes until it kinda worked. The…

The original team may not have been the best at the task, but they still managed to deliver 100 MM in revenue. Sometimes the things they leave behind/ignore simply don’t matter to the business/useful tech.

Particular to ad tech, the lifespan of any particular software is lower than you’d expect (unless your google/Facebook). Technology that pays out big one year will become pretty meh within 3 years. In the case above I’d argue that the new tech team didn’t really understand this dynamic and so they focused on the wrong things such as rewriting functionality that didn’t matter for the future. Or making big bets on aspects of the product which were irrelevant.

To the OP, we don’t know that the lifespan of any of these php files is greater than an individual contract. If the business can be modeled as solve a contract by putting a php file on prod - rewriting may be entirely worthless as the code can be “write once, read never”.

Re: Ask HN: Inherited the worst code and tech team I have ever seen. How to fix it?

#502
post #398

The worst tech team you've ever seen and yet they are generating 20 million a year? I think you should give them the respect they deserve and understand the limitations they have been under. My thoughts: * Get the code in source control straight away * Get the infrastructure stable and up to date if it's not * Get CI pipelines set up. As part of this, make sure the code is running through a static analyser. This will…

> The worst tech team you've ever seen and yet they are generating 20 million a year? I think you should give them the respect they deserve and understand the limitations they have been under.

If the right opportunity is there, you can make a lot of money on an awfully built product that barely keeps it together. That doesn’t mean that there aren’t a lot of risks involved with that and that things can’t go south in a hurry.

I’m obviously not familiar with this project, but it sounds like a lot of things many’d consider table stakes are missing, especially for such a large source of revenue. Perhaps I’m not imaginitive enough, but I can’t come up with any limitations they might’ve been under that would justify that. I think it’s fair to call that out, even if they happen to make money despite this.

Re: Ask HN: Inherited the worst code and tech team I have ever seen. How to fix it?

#504
Working in a similar company, they don't generate as much revenue but the codebase is that really messy mix of data and implementation details, imperatively brute-forced into a "stable" lucky build

I took the e2e approach, since making any changes is having that huge domino-effect of breaking everything else. I think it's really important to setup a proper build/e2e CI pipeline with instant Slack reports, and run this pipeline on every commit, from this point you can just add specs to fully cover it and then it can be released nightly without a fuss

Re: Ask HN: Inherited the worst code and tech team I have ever seen. How to fix it?

#506

First off, no, a full rewrite is not only not necessary, but probably the worst possible approach. Do a piece at a time. You will eventually have re-written all the code, but do not ever fall into the trap of a "full re-write". It doesn't work. But before you re-write once line of code - get some testing in place. Or, a lot of testing. If you have end-to-end tests that run through every feature that is currently used…

I fully agree with this, but I think it misses a key step: As the team’s manager, it’s your job to get buy-in from the executives to gradually fix the mess. You don’t need to tell the team exactly how to fix it, but you gotta get buy-in for space to fix it. One approach is just to say “every Friday goes to adding tests!” (And then when there’s some reasonable test coverage, make fridays go to refactoring that are eas…

> But this often fails because when Friday comes, something is on fire and management asks to please quickly squeeze this one thing in first.

There's a solution to this problem: nothing goes live on Fridays.

> and making the code touched by that change better.

Getting buy-in from management on this always appeared to me as weird. The alternative is a codebase that can only ever get worse over time. So you either gotta gold plate everything, which will take way longer than allowing for some after-the-fact improvement as needed, or your codebase turns into a pile of shit very quickly and your velocity grinds to a halt very quickly.

Re: Ask HN: Inherited the worst code and tech team I have ever seen. How to fix it?

#507
Take a look at The Strangler Pattern, coined by Martin Fowler. That approach lays out a technique for replacing each part of complexity into a modern codebase by "strangling" each unit of functionality individually.

It takes time, but the outcome is a fully tested version of the already production-tested software, and there's no need to maintain two versions.

Re: Ask HN: Inherited the worst code and tech team I have ever seen. How to fix it?

#508
I know that in this era we no longer recommend books, but, get the book “Working with Legacy Code” by Michael Feathers for ideas and approaches here. It’s hugely helpful. It won’t solve all the problems (that’s on you) but it will show you starting points, give you hope, and show lights at the end of the tunnel. It’s a bit focused on testing and moving to TDD, but don’t make the mistake of thinking that’s all it offers.

Re: Ask HN: Inherited the worst code and tech team I have ever seen. How to fix it?

#509

A lovely knot to unravel! First, get everything in source control! Next, make it possible to spin service up locally, pointing at production DB. Then, get the db running locally. Then get another server and get cd to that server, including creating the db, schema, and sample data. Then add tests, run on pr, then code review, then auto deploy to new server. This should stop the bleeding… no more index-new_2021-test-jo…

[deleted]

Re: Ask HN: Inherited the worst code and tech team I have ever seen. How to fix it?

#510
post #339

Earlier quoted context omitted.

And also starting by fixing the js/css/html front end is likely the safest, as it wont corrupt any customer data & it will be visible when something breaks. That can probably be the next best candidate to do a major overhaul. I'd also hope that a $20M/year project can afford to hire someone senior in addition to these 3 juniors?

why would someone senior even want to join this team? Especially someone senior enough to fix this. The productivity is horrible and there's no kudos for fixing something that's lived for 12 years like this.

Theoretically a company that's making $20m/year on this can afford to make it worth someone's while to come in and fix it. The problem isn't finding someone who will do it, it's that the company assumes they can continue to get by indefinitely on paying too little.
Post reply on HN