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

591–600 of 704 posts

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

#591
post #152

People suggest rewriting little-by-little. Does that really work in practice? And why would one do it? Why not let that business rot-in-place so to speak, while building a new business on a new platform to "compete" with it? I worked for a company early in my career that sold a $1500 piece of software and had revenue of $15 million. When I was there, the head could was 70. Ten years later the head count is two - one…

Rewriting little by little just means: each time you make a change, leave the source base at least a little better than you found it. Leave a few comments about the thing you reverse engineered. Delete a little dead code. Eventually you get the confidence to move from the lowest hanging fruit to deeper refactoring. You do it because that approach may be the best you can do with a rotten source base within your time a…

Honestly, that sounds like making bad code even worse.

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

#592

Thank you for so many suggestions. The main issue is productivity within a context where the company is trying to reinvent itself in terms of marketing and business model. This has for consequence that many new big features are being requested and promised by management to headquarters. But in the last years, all bug evolutions have been failures. That's why I've been asked to intervene. I love the idea of the strang…

You may be interested in this article:

https://medium.com/@kris-nova/organic-and-mechanistic-system...

What you are dealing with is organically grown software. No one really understands it, and it's likely to be fragile.

I agree with all those here that say the first thing to do is to introduce version control. You don't want to break that money machine without a way to revert.

Second, introduce some lightweight form of code review, but don't tick people off.

Third, if you want to do something like revise the user interface, consider adding an API to the existing organic code base, and build the new UI with that API. Generally, take that approach and avoid jamming something into the middle of the existing code that no one fully understands.

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

#593
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…

To be fair if I was an exec at a company and the new IT lead wants me to commit, in writing, to XYZ, I’d not keep them around long. You can’t run a company on that kind of deep mistrust. 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…

Do leads not write proposals or RFCs? I’m not sure why you wouldn’t keep them around long if they laid out their plans in a clear way, and then pitched it to others

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

#594

Earlier quoted context omitted.

> if I was an exec at a company and the new IT lead wants me to commit, in writing, to XYZ, I’d not keep them around long. You can’t run a company on that kind of deep mistrust. Emails are writing, if you're imagining the IT lead walking in with a paper contract I see why you would say that.

That's essentially what the GP was implying, "Have everything in writing, complete with date and signatures."

That’s what a proposal is too, it’s not necessarily a demand

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

#595
post #566

Earlier quoted context omitted.

> I suspect OP does not have the corporate experience to handle this situation. I agree with this. OP doesn't say, but reading between the lines, corporate at best doesn't understand the ramifications, but corporate doesn't care about the ramifications. They're getting 20 million in revenue from 3 cheap devs. Things are going great, according to corporate. They're not going to learn, and OP is going to get blamed whe…

>snowball them Could you define this phrase and what English dialect it's from?

> what English dialect it's from?

I assume American English.

Prior to the sexual slang made popular by the movie Clerks, snowballing in the context I used basically means to blindside or con someone.

One definition on Urban Dictionary:

"A situation where a criminal has found themselves in possession of an easy target and proceeds to rob them and leave them mortally wounded for fun, a synonym for getting iced."

There's also snowballing meaning a problem getting bigger and bigger when unaddressed. I'm probably using it in an older, not-exactly-mainstream way.

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

#596

Earlier quoted context omitted.

> Let's say you start to write tests and start to see issues crop up. Now what? How do you fix those things? I assumed the tests wouldn't be for correctness, but for compatibility. If issues crop up, you reproduce the issues exactly in the rewrite until you can prove no one depends on them (Chesterton's fence and all). The backwards-compatibility-at-all-costs approach makes sense if the product has downstream integra…

> I assumed the tests wouldn't be for correctness, but for compatibility. You're assuming that the people coming in to write these tests can even make that distinction. How do you even know what the compatibility should be without really diving deep into the code itself? Given how screwed up the codebase already is, it could be multiple layers of things work against each other. OP mentioned multiple versions of jquer…

> How do you even know what the compatibility should be without really diving deep into the code itself?

You can pretty much black-box the code and only deep dive when there are differences. Here's what I've done in the past for a rewrite of an over-the-network service:

1. Grab happy-path results from prod (wireshark pcap, HTTP Archive, etc), write end-to-end tests based on these to enable development-time tests that would catch the most blatant of regressions.

2. Add a lot of logging to the old system and in corresponding places in the new system. If you have sufficient volumes, you can compare statistical anomalies between the 2 systems

3. Get a production traffic from a port mirror, compare the response of your rewritten service against the old service one route at a time. Log any discrepancies and fix them before going live, this is how you catch hard-to-test compat issues

4. Optionally perform phased roll out, with option to roll back

5. Monitor roll out for an acceptable period, if successful, delete old code/route and move to the next one.

The above makes sense when backwards compatibility is absolutely necessary. however, the upsides is once you've set up the tooling and the processes, subsequent changes are faster.

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

#597

Earlier quoted context omitted.

Not sure the little hammer will fix much. And making folks use a method in new code pisses them off. "You say important I do this your way this time, even though there are 1000 examples of doing it the other way. I feel persecuted and your way is pointless, because it doesn't fix everything anyway. And its slowing me down and making me look bad." Not rational but folks don't have to explain their feelings. You will b…

The little hammer definitely fixes. It does it in the same way as water cut the grand canyon. The beauty is that it works over time. Now as for how to get the other devs on board, I agree with you that you can't just barge in and tell them everything they are doing is wrong etc. I never said to do that and I'm replying to a specific comment in the thread not the original Ask HN. I.e. when I write about what I've done…

Startups have runway and can die when big-company processes forced up on them. It can sink them.

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

#598

Earlier quoted context omitted.

The little hammer definitely fixes. It does it in the same way as water cut the grand canyon. The beauty is that it works over time. Now as for how to get the other devs on board, I agree with you that you can't just barge in and tell them everything they are doing is wrong etc. I never said to do that and I'm replying to a specific comment in the thread not the original Ask HN. I.e. when I write about what I've done…

Startups have runway and can die when big-company processes forced up on them. It can sink them.

I'm not sure where you're pulling that from. There's no mention of startup here. Neither in the original (actually the opposite I'd say, 12 years and just a business unit).

None of what I said is a big-company process in any way. If in your book using source control is a big company process that will sink a startup then be my guest and I will just hope we never have to work together. Source control is a no-brainer that I even use just for myself, have used in teams of two and teams dozens to hundres. The amount of process around is what scale with the kind of company. Source control is useful by itself in every single size of company.

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

#599

Earlier quoted context omitted.

Startups have runway and can die when big-company processes forced up on them. It can sink them.

I'm not sure where you're pulling that from. There's no mention of startup here. Neither in the original (actually the opposite I'd say, 12 years and just a business unit). None of what I said is a big-company process in any way. If in your book using source control is a big company process that will sink a startup then be my guest and I will just hope we never have to work together. Source control is a no-brainer th…

Source control is necessary and simple, yes.

Code review, coding standards, required tests for everything, multiple stages of deployment - are not simple and can stall development. Done wrong they can sink a company.

It's easy to read the worst possible construction on what other people write here. It's never a good idea.

Btw I worked at a startup for 8 years. It was still a startup, depending on new investment to meet the monthly. In any case the described dev group was behaving in a way that used to be typical of startups. And even business units in larger organizations have runway.

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

#600
post #585

Earlier quoted context omitted.

Right but how do you replace the masts? Don’t you have to build mast2 and then tear down mast1 if you want to have continuous propulsion?

Yes, can you see how that's quite different from building a second ship?

In my comment, X and Y are different masts, not different ships.
Post reply on HN