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

641–650 of 704 posts

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

#641

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…

This sounds like solid advice. A rewrite would be a world of hurt, particularly if you don’t have buy-in from the existing team.

Regarding the team, junior they may be, as he says, but they’re rolling with a multi-mullion dollar product. If they’re keeping the product going and continuing to add business value, then they’re doing something right. Their engineering practices might be questionable, but they seem to have a solid product.

However, getting testing in place is going to be a challenge. I’ve encountered systems that sound similar to this one (perfectly functional, zero discernible architecture, not remotely designed with any kind of testing in mind.) It’ll be difficult to convince the suits that introducing testing has any real value when you’re starting from zero.

The first thing than comes to mind is the strangler fig pattern. Sounds like a useful idea in this instance.

> …an alternative [to a re-write] is to gradually create a new system around the edges of the old, letting it grow slowly over several years until the old system is strangled.[0]

[0] https://martinfowler.com/bliki/StranglerFigApplication.html

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

#642
You already know…

Each question you have above should be solved in an order that makes sense.

Full rewrites do not make sense if you plan to put on hold the project. You have to make a greenfield space within the mud.

I recently did this, I inherited an Angular 1/Java project and someone had already hired my team they hired 6 React/Node Devs. They were JS devs but not angular. We just started embedding React in the Angular routes, also product team wanted a new design. So we had two themes, old and new at a certain point we were 80% there and made a push for the final 20%. Took 1.5 years to rewrite a FE e-commerce app.

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

#643
post #154

Earlier quoted context omitted.

> team is 3 people, quite junior. Even at FAANG salaries this wouldn't be that much compared with $20M

Yes, but the parent is saying this could be an e-commerce website, or construction company, etc. But having an iOS app feels unnecessary for most of these businesses

a lot of field operations these days are done on phone or tablet apps, so I can totally see an ios developer being vital for internal processes

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

#644

You already know… Each question you have above should be solved in an order that makes sense. Full rewrites do not make sense if you plan to put on hold the project. You have to make a greenfield space within the mud. I recently did this, I inherited an Angular 1/Java project and someone had already hired my team they hired 6 React/Node Devs. They were JS devs but not angular. We just started embedding React in the A…

Also don’t be an a*h**…

Be careful you don’t demotivate the team by complaining…

Use sentences like “We can do better” and remember that the past is the past, focus on the future, lead them forward.

They obviously do not know better and need your help. Teach them, be the leader they need and you will be so proud of the work you do together and the people you helped to do better.

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

#645

Lots of people are giving advice on how to fix the code piecemeal. First put it on Git, then add tests, then, carefully and gradually, start fixing the issues. Depending on the project, this could take a year or several years, which isn't bad. The problem with this plan is corporate politics. Say that OP takes on this challenge. He makes a plan and carefully and patiently executes it. Say that in six months he's alre…

at which point you leave, having spent a satisfying six months improving things for the other devs

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

#646
Such a great opportunity to get in as an engineer and make a difference. The good news is the code is running in production and generates revenue! From here you can start making small incremental changes. I would start in this order.

1. Make it script version controlled. 2. modularise the code. This will help in understanding the structure. 3. Add the dependency management. 4. improve the code deployment process. CI/CD etc.

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

#648

Earlier quoted context omitted.

> Next, make it possible to spin service up locally, pointing at production DB. I think this is bad advice, just skip it. I would make a fresh copy of the production DB, remove PII if/where necessary and then work from a local DB. Make sure your DB server version is the same as on prod, same env etc. You never know what type of routines you trigger when testing out things - and you do not want to hit the prod DB with…

I am inclined to agree. The other advice was excellent, but pointing local instances to production databases is a footgun.

I've kind of reconsidered this a bit. Right now, the only way to test that the database and frontend interact properly is to visit the website and enter data and see it reflected either in the database or in the frontend.

It's less terrible to have a local instance that does the same thing. As long as the immediate next step is setting up and running a local database.

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

#650
Nothing wrong with what you describe, all successful long running projects stink up. I would look into the “strangler pattern” and start from there. Once the team understands the benefits of clean code they will give their full backing and you will he able to gradually evolve the codebase and practices. Resistance to change comes when people feel threatened. These “junior” developers have been maintaining a cash cow for quite some time. I would change the wording and intended actions in such way that they understand they will also benefit from upcoming changes in tech and practice. Those that are genuinely dicks should be let go but only after they’ve been given a genuine chance.
Post reply on HN