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

671–680 of 704 posts

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

#671

Earlier quoted context omitted.

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

All of that, while technically correct and possible, is vastly more complicated and time intensive than a rewrite of what the OPs description of the codebase is.

Yes, it absolutely is - but the trade off is a far lower risk of introducing breaking changes. Depending on the industry/market/clients - it may be the right tradeoff

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

#672
post #202
post #117

Earlier quoted context omitted.

$20M revenue is not the same as $20M profit.

It’s not the same, but if those 20M is primarily generated by the software, then it’s those 3 ppl, who contribute to the top line. The rest, like sales, marketing, are irrelevant: fire them and the product will keep generating revenue off the existing customer base. It will stop doing so, however, if the product brakes. So, the post above is right to an extent, this is the golden goose. ))

Not if they're spending $19m in google ads to make $20m in revenue.

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

#673
post #654
post #590

Earlier quoted context omitted.

Yep. views in RDBMS are much underrated, IMO just because they are old tech. It should be possible to use views to: 1) normalise the database (fold these ugly add-on tables as columns in the parent table, with suitable null constraints, then drop the add-on table). 2) Use views to add the add-on tables (now views) back in again. 3) Continue running the old application code against the views, which present the old, ug…

This use allow to update SELECT operations, but UPDATE / DELETE still have to be done on the old underlying schema right ? No way to trigger a DELETE from a view right ? How would you approach this ?

Views can be updatable though there are caveats, but deletes and updats can be done via a function or stored procedure, meaning there's no direct access by the app to the underlying schema. If it's done well it means that the calling code in the app won't have to change (or at least be minimised) even as the schema changes. The speed and security benefits are a nice by-product.

You can even do things like prevent the app from deleting things unless the functions are used and prevent poor development practices in the process.

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

#675
post #64

> this code generates more than 20 million dollars a year of revenue From a business perspective, nothing is broken. In fact, they laid a golden goose. > team is 3 people, quite junior. One backend, one front, one iOS/android. Resistance to change is huge. My mistake, they didn't lay a golden goose--they built a money printer. The ROI here is insane. > productivity is abysmal which is understandable. The mess is just…

THIS. A million times this. The world is about solving real user problems. And obviously this code solves a huge 20M USD problem. And the code is obviously so good, that even 3 "bozos" (to use your language) can manage and maintain in for decades. This is the holy grail. I wouldn't change a thing and instead ask: how can you make this generate 40M USD a year? This is how you will add real value to the company, and management will love you.

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

#676

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…

Among the things I'd prioritize is to make a map of all services/APIs/site structure and how everything falls into place. This would help you make informed decisions when adding new features or assessing which part of the monolith is most prone to failure.

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

#677
post #64

> this code generates more than 20 million dollars a year of revenue From a business perspective, nothing is broken. In fact, they laid a golden goose. > team is 3 people, quite junior. One backend, one front, one iOS/android. Resistance to change is huge. My mistake, they didn't lay a golden goose--they built a money printer. The ROI here is insane. > productivity is abysmal which is understandable. The mess is just…

If the mess generates $20m a year, that's great and I agree with you!

If the mess generated $20m last year and it's projected to generate $20m next year, that's a problem.

If the second case is true, I believe it's somewhat the responsibility of the OP to sell solving this long-term problem to the _rest of_ business. If they hired him as an expert in that area, they should listen to him.

If that fails, leave.

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

#678

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…

I agree with this. I built an open source package that should work for you in this situation with no version control in it. https://github.com/n0nag0n/commie2 Get this installed internally and then start doing some "lightweight" code reviews. Your other team members can get emails about any comments you make and it'll be lightweight collaboration.

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

#679

Earlier quoted context omitted.

It just feels like an amateur hour thing. If my plumber came to me to ask if he can just dry assemble the pipes and leave them that way I'm gonna get a new plumber.

That’s assuming you know something about plumbing. If you don’t, you’ll just nod your head and say ok, that sounds good. The same thing is happening in these businesses. The business owners generally don’t know programming. Terms like “refactoring” mean nothing to them at best and sounds like “rewrite from scratch” at worst.

[deleted]

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

#680

Earlier quoted context omitted.

All of that, while technically correct and possible, is vastly more complicated and time intensive than a rewrite of what the OPs description of the codebase is.

Yes, it absolutely is - but the trade off is a far lower risk of introducing breaking changes. Depending on the industry/market/clients - it may be the right tradeoff

In my eyes, a rewrite won't be introducing breaking changes. It would be to figure out what functionality makes money, then replicate that functionality as best as possible so that the company can continue to make money as well as build upon the product to make even more money.

We're talking about a webapp here, not rocket science.

Post reply on HN