First of all: PHP is fine. It really is. Second: Doing a full rewrite with a junior team is not going to end well. They’ll just make other mistakes in the rewritten app, and then you’ll be back where your started. You need to gradually introduce better engineering practices, while at the same time keeping the project up and running (i.e. meeting business needs). I’d start with introducing revision control (git), then…
Ask HN: Inherited the worst code and tech team I have ever seen. How to fix it?
441–450 of 704 posts
Re: Ask HN: Inherited the worst code and tech team I have ever seen. How to fix it?
#442Earlier quoted context omitted.
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…
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…
Nothing in the OP suggests abusive management. Incompetence, maybe, but I see no reason to assume that they’ll backtrack on agreements, and a new management hire who immediately starts sewing mistrusts is not someone I’d trust to get things to a higher level.
Re: Ask HN: Inherited the worst code and tech team I have ever seen. How to fix it?
#443Earlier quoted context omitted.
Source control seems like a straightforward first step, regardless of what approach is going to be taken going forward
One would think, but how do you go from source control to deployment on the production server though? If they were editing files on the server directly, there could be a whole mess of symlinks and whatever else on there. Even worse, how do you even test things to see if you break anything? It is a can of worms.
Been there, done that. Slightly differently where they had a test server and prod server. So already better except one day I made a change and copied to prod. Yes it was manual. Just scp the files over to prod. And stuff broke. Turned out someone had fixed a bug directly in prod but never made the change on the test server.
First thing I did was to introduce version control and create a script to do make deployment automatic meaning it was just a version control update on Prod (also scripting languages here). Magically we never had an issue with bugs reappearing after that.
Pretty simple change and you can go from there.
The above code base was over 20 years old and made use of various different scripting languages and technologies including some of the business logic being in stored procedures. Zero test coverage anywhere. You just 'hide' small incremental changes to make things better in everything you do. Gotta touch this part because they want a change? Well it could break anyhow so make it better and if it breaks, it breaks and you fix it. It needs judgment though. Don't rewrite an entire module when the ask was adding a field somewhere. Make it proportional to the change you need to make and sometimes it's not going to be worth it to make something better. Just leave it.
Re: Ask HN: Inherited the worst code and tech team I have ever seen. How to fix it?
#444Earlier quoted context omitted.
This is the right way to think about it. My only disagreement is that I'd do the local DB before the local service. A bunch of local versions of the service pointing at the production DB sounds like a time bomb. And it's definitely worth emphasizing that having no framework, MVC, or templating library is not a real problem. Those things are nice if you're familiar with them, but if the team is familiar with 2003 vint…
> if the team is familiar with 2003 vintage PHP, you should meet them there. That's still a thing you can write a website in. You can write a website in it, but you cannot test it for shit.
Re: Ask HN: Inherited the worst code and tech team I have ever seen. How to fix it?
#445If you can't change the culture and get your boss(es) on board, then you will fail.
Right now, the business is likely "mostly happy" with things the way they are. They're getting their changes made (but not as quickly as they'd like). Their costs are low (3 junior devs, with just their laptops and a production server). Convince them that unless the changes you want are made, their business will become stagnant. Use phrases like "invest for future growth" and "protect the business' current investment in the product"
Re: Ask HN: Inherited the worst code and tech team I have ever seen. How to fix it?
#446Re: Ask HN: Inherited the worst code and tech team I have ever seen. How to fix it?
#447So I think the first option you should strongly consider is just running. It's a valid tactic and if the management team is difficult, is probably the best one for you. If you stay you need to manage your relationship with the management team. This involves the usual reporting, lunches etc. You need to setup some sort of metrics immediately. Just quarterly might be sufficient. Nobody is going to care about bug fix co…
Re: Ask HN: Inherited the worst code and tech team I have ever seen. How to fix it?
#448Or just quit that job, it might not be worth staying there.
Resistance mean it is a situation of hostage taking: https://neilonsoftware.com/difficult-people-on-software-proj...
It's very serious and coders do this for job security. Don't accept this BS.
Re: Ask HN: Inherited the worst code and tech team I have ever seen. How to fix it?
#449Earlier quoted context omitted.
OP is leading a team, not hiding in a churning out code. The "secret superpower" strategy doesn't work here.
Where does OP say they are team lead? They sound like a junior.
Clearly responsible for team outcomes
> without managing them directly
Not a people manager. Most likely a tech lead or a technical project manager
Re: Ask HN: Inherited the worst code and tech team I have ever seen. How to fix it?
#450> - it has been developed for 12 years directly on production with no source control ( hello index-new_2021-test-john_v2.php )
First step would be to get that into source control.
> - the routing is managed exclusively as rewrites in NGInX ( the NGInX config is around 10,000 lines )
This might be a benefit actually. I'd just start a new application and route to the new code one-by-one using the Strangler approach.