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

421–430 of 704 posts

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

#421
post #66

Earlier quoted context omitted.

> It doesn't work. That's simply not true. I've inherited something just as bad as this. We did a full rewrite and it was quite successful and the company went on to triple the revenue. > get some testing in place Writing tests for something that is already not functional, will be a waste of time. How do you fix the things that the test prove are broken? It is better to spend the time figuring out what all the featur…

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…

Anecdotal: I asked people why they keep incorrectly using jQuery methods and produce ambiguous, difficult-to-maintain code in the year of 2022. (we still have jQuery as a dependency for legacy code.) The response was that they were not aware that native counterparts like document.querySelectorAll exist in the browser. They just copied the old jQuery code, modified them, and it worked.

I am pretty sure this kind of thing exists in any large legacy codebase.

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

#422
You need to develop an small app that will handle authentication/authorization. Next time a feature comes you will implement that page in the new stack, the rest of production pages will still run in the old code base .

That's it.

A concurrent small migration to the new system without changing all the system at once.

Why it works? New systems often fail to encapsulate all the complexity. also two systems, duplicate your workload until you decide to drop new system because of the first statement.

Finally, get stats from nginx and figure out which routes aren't used in a month, try disabled some and see how much dead routes you can find and clean

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

#423
If the code works...at least for now...don't mess with it. $20M p/yr is significant. Simply put, you don't know what lurks in the bowls (i.e., one refactoring could create more problems than it solves. The code can wait.

The team is another issue. That's where you need to make an immediate impact. But give them each the benefit of the doubt. Start by speaking with them individually. Then as a team. Establish a relationship(s). And then nudge by nudge make changes, changes to culture, workflow, coding standards, etc.

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

#424
post #66

Earlier quoted context omitted.

> It doesn't work. That's simply not true. I've inherited something just as bad as this. We did a full rewrite and it was quite successful and the company went on to triple the revenue. > get some testing in place Writing tests for something that is already not functional, will be a waste of time. How do you fix the things that the test prove are broken? It is better to spend the time figuring out what all the featur…

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…

I did a rewrite of a 30 year old bit of perl/php2 over the last year. Not knowing why things were the way they were was really useful for the younger team members and me to get familiar with the codebase and the business context.

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

#425
>> HQ has no real understanding of these blockers. And post COVID, budget is really tight

You are probably better off leaving. You'll have to solve a culture problem and a technology problem at the same time. Each step of the process will be an uphill battle and even if you do succeed no one will notice since the app will look the same. The appetite for change will only materialize once market share and revenues start to drop, at which point it will likely be too late.

You'll need to be the CEO or trusted executive to effect this kind of change. Trying to do this from a middle management or dev position won't work and will come at enormous personal cost.

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

#426
post #283
post #208

Earlier quoted context omitted.

You don't not use source control because nobody directed you to and you 'accidentally' .. what, forgot about it? You don't use it because you haven't heard of it; = not competent.

I find it hard to imagine you’d never heard of source control by now. You’d have to have been living under a rock for the past 15 years.

Or be a bona fide 'script kiddy', learnt some WordPress PHP or whatever and got a job as 'webmaster' or something straight out of school (UK-sense, I specifically mean no university), no formal CS/software eng. training, never properly an intern/junior trained by people who know what they're doing.

I'm sure it happens. And then you get the next job with 5y PHP experience or whatever, employer doesn't mind no formal training (not that I'm saying they should in general - but if they're non-technical hiring someone to 'do it', or first hire to build the team or whatever, then they probably should as a reasonable proxy!), rinse and repeat.

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

#427
Have this team do read-only deep dives in the system and document what they find, highlight any potential opportunities to improve the system (without edit), and have them form a plan for replacement or migration to something that you have a new team build.

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

#428
post #331

Earlier quoted context omitted.

Before anything else, getting buy-in for any kind of major change from the execs is key. Explain the situation and the effects. Have everything in writing, complete with date and signatures. Push back hard every time this commitment gets sabotaged because something is supposedly on fire. Get a guaranteed budget for external trainings and workshops, again in writing. Then talk to the team. If you cannot get those comm…

"Have everything in writing, complete with date and signatures" It is possible that the executives won't take it well to all of the formality here (writing and signatures). How would you convince them that this is necessary?

"Have everything in writing" is a bad mindset and is not going to save you.

Exeutives are looking at you as the expert to deliver a good outcome. Which means making good decisions, managing expectations and keeping everyone in the loop.

Generally, if it gets to the point of having to dig up who signed off on what, you've already failed. Often you won't even get the chance to dig up those emails, because delivering a bad outcome is enough for execs to write you off without even needing to hear your excuses.

Post reply on HN