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

661–670 of 704 posts

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

#662
post #395

Earlier quoted context omitted.

Good answer. Some developpers seem to think that their jobs is to engineer nice and beautiful systems. It's not. As a developper, you're getting paid (fyi the minimum so you don't leave the company) in order to maximise total shareholders' returns. That's it. The business doesn't care if the codebase is garbage, with massive technical debt, nor if you struggle working with it. That's literally not even a problem as l…

Nice and beautiful systems aren't the job, but a system that will continue working in the future while still allowing people to keep adding features and that won't suffer massive security breaches really is. It sounds like the current system is one bad feature implementation away from hosing the database, one hardware fault away from no longer existing, and one interested hacker away from a complete compromise.

You are right and obviously good engineering practices are not incompatible with the company’s interests.

I was more reacting to OPs attitude, where he asks how to fix everything without even being clear if he is managing the team or officially in charge of the product.

I may be mistaken but the impression I have is that the management is perfectly happy with a bad system and expects the engineers to simply go along. This is then a management decision. It may blow up later and sink the business (or not, it can just hold for the lifetime of the product).

As far as OP is concerned, this situation would mean that he should probably leave the ship now. (As staying would probably result in 1. No marketable skill development (being stuck with a garbage codebase) 2. Burn-out has he takes on the Herculean task of cleaning it up. 3. Be blamed if something bad happens.

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

#663
>>>>Stop the bleeding>>>Learn a better approach>>>Do betterI agree with the sentiment that a full rewrite is a waste of time. The team needs to learn better practices, together, or any rewrite will fall into the same pattern. We've had great success doing side-by-side upgrades (from AngularJS to React as an example). > All new features (screens) build on React (newest) > Run them in the same path, so it looks like a single app > Each sprint has additional upgrade work to start porting over to React > Use the customer and usage analytics to refactor screen, flow, function, while rewriting

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

#664
post #395

Earlier quoted context omitted.

Good answer. Some developpers seem to think that their jobs is to engineer nice and beautiful systems. It's not. As a developper, you're getting paid (fyi the minimum so you don't leave the company) in order to maximise total shareholders' returns. That's it. The business doesn't care if the codebase is garbage, with massive technical debt, nor if you struggle working with it. That's literally not even a problem as l…

Usually nothing changes for me as a developer if shareholders get bigger returns on their investments. So I don't really care. What I care about is the code quality because good code makes my job easier. I inherited the code, not the business.

Well it is the management’s job to make your work aligned with the company’s best interests.

It is possible that you’re already doing what you’re getting paid for. In that case you shouldn’t go out of your way to increase the company’s profits (and nobody expects you to).

(In my original post I didn’t say that as a developer you should code thinking of quarterly results, I just stated the obvious that you are employed for the shareholders to get money back)

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

#665

Earlier quoted context omitted.

> Getting buy-in from management on this always appeared to me as weird. The alternative is a codebase that can only ever get worse over time. Well that's just the thing: they have no notion of a "bad code base". To them that's an excuse and a negotiation leverage by the programmer to ask for more money. They judge others by themselves I guess.

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.

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

#668

> I know a full rewrite is necessary, but how to balance it? A full rewrite of a functional 12-year old application? Yea, you're going to waste years and deliver something that is functionaly worse than what you have. It took 12-years to build it would realistically take years to rebuild. Fixing this will take years and honestly some serious skill. What you want to do is build something in front of your mudball appli…

The approach outlined above is the approach I would take (and have previously taken). Some details that I personally think are important:

Step 0. Setup typescript with version control for your current JS mess.

Step 1. FWIW, with ReactDOM.renderToString you can use JSX as your template engine.

Step 2. Move all of your PHP views to JSX views, PHP keeps returning JSON.

Step 3. Abuse component.unmount(); component = ReactDOM.createRoot(…); to get components with view state, but also can get updated by regular JS events that require a rerender just like you would with the legacy jQuery code.

Step 4. Keep pushing more of the logic from the legacy jQuery code and PHP code into React/Typescript. You’ll find that the React components will keep getting grouped and you can start to compose more of the widgets together.

Step 5. You end up with one big React app, minimal PHP (that is easy to test), and a decision about how to manage your state.

At this point it’ll be in shape to not need a lot of attention. Truly, the DB mess will figure itself out as your PHP continually becomes minimal and well tested.

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

#669
I would leave the company and search another workplace where the codebase is not dogshit.

There is simply no solution to this problem, so you better leave and go to work where things are actually handled by professional engineers and not some non-dev shitty manager. Simple as.

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

#670

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]
Post reply on HN