Live data from Hacker News

Ask HN: Codebase at my work is a complete mess, what should I do?

news.ycombinator.com

301–310 of 346 posts

Re: Ask HN: Codebase at my work is a complete mess, what should I do?

#301

Don't fix things just for the sake of fixing them. Let new features, bugs, or necessary performance improvements drive your changes. Keep your changes small and focused. You need to ensure that you're delivering business value with each change, rather than embarking on an overwhelming, open-ended task. This is critical if you want the business to support your effort. It demonstrates pragmatism. It will shrink the sco…

I came to recommend Feathers' book. Those strategies will save your bacon when you go to solve these problems. I put it in the "must read" list for all mid-level engineers.

To be fair, I put all three of those in my must read category.

Re: Ask HN: Codebase at my work is a complete mess, what should I do?

#302

Earlier quoted context omitted.

Surely in a commercial setting the primary factor is RoI rather than time? Will rewriting this old, stable, code increase profits or substantial reduce revenue impacting risks? #notacoder

> Surely in a commercial setting the primary factor is RoI rather than time If it's a smaller company (op mentioned 50-100 people) they might not even know what RoI is, and/or might not care about it.

That's a strange comment, surely it's impossible to stay in business and not understand RoI to some degree.

Re: Ask HN: Codebase at my work is a complete mess, what should I do?

#303
post #184

Earlier quoted context omitted.

> Being able to read and work effectively in legacy code is an essential skill for any software engineer. This is key advise. It makes the difference between a person who enjoys the art of coding and a professional who get paid for work. Basically you have to first proof why the invest of rewriting brings any financial benefit. Till then, be professional and maintain it.

Just to offer a different opinion here: I think happiness at work is the most important thing for me personally, and I have no patience for legacy codebases that look like shit. I mean, you are offering good advice for a person that wants to fit in as his highest priority, no doubt about that. But there are people (like me) who don't enjoy working deep down in complicated shitty code to the degree that I don't even w…

Working on legacy codebases better designed than I could have come up with hasn't been much of an improvement for me. There is a certain quality of "habitable" for a codebase that tends to get tossed when people create a tightly abstracted object-oriented design. Peter Norvig and Richard Gabriel in their writings mention organizing software "fractally" from top to bottom, which I haven't really been able to figure out yet, other than it must involve some careful use of repetition. Apparently, it can help create those qualities.

Re: Ask HN: Codebase at my work is a complete mess, what should I do?

#304

Earlier quoted context omitted.

These people should have asked to see a sample of what they were going to have to work on.

They didn’t even have a look at the code. Their task would have been to write and maintain end-user documentation and they left before they even had computer and stuff set up. Just never came back from lunch. Said they’d not feel up to the task. I was just a student at that time, so I can’t really say if that was a hiring fuckup or just an odd person. Certainly one of the weirder things to witness in my career.

Most likely explanation is that this person received a better job offer and did not wanted to let your company know.

Re: Ask HN: Codebase at my work is a complete mess, what should I do?

#305
post #201

Earlier quoted context omitted.

>> My advice is don't complain and don't attempt any significant rewrites for the first 6 months or so. I would agree with this, you need to be careful. I've seen a friend start at a new company with a horrendous code base, bring up the issues and be let go because they hurt / offended the existing developers. SOme people are really precious about their shitty code and can't take criticism, esepcially in small compan…

> I would agree with this, you need to be careful. I've seen a friend start at a new company with a horrendous code base, bring up the issues and be let go because they hurt / offended the existing developers. I'm not sure if I agree. As a programmer I feel my primary responsibility is towards the code, not the company, not my colleagues feelings, not the customer. There are other roles who speak for them (sales, pro…

I agree that ideas should be judged on their merits but you're still dealing with human beings. Someone could approach a bad codebase and say, "Here are some ways we could improve X, Y, and Z," but you could have another person say, "This was done in the stupidest way possible, we have to throw all this crap out."

If someone approaches things politely and professionally then no one should have a problem with constructive suggestions for improvement. But people sometimes approach things in a combative or disrespectful manner and that's when you run into problems.

Re: Ask HN: Codebase at my work is a complete mess, what should I do?

#306
post #201

I've been on both sides of this issue in the span of my career. I've joined companies with absolutely horrific code, and I've hired people who thought my code was shit. My advice is don't complain and don't attempt any significant rewrites for the first 6 months or so. Your job at first is simply to understand the code and demonstrate that you are able make improvements to it without breaking everything. Doing so wil…

>> My advice is don't complain and don't attempt any significant rewrites for the first 6 months or so. I would agree with this, you need to be careful. I've seen a friend start at a new company with a horrendous code base, bring up the issues and be let go because they hurt / offended the existing developers. SOme people are really precious about their shitty code and can't take criticism, esepcially in small compan…

Disagree, joined a company 3 months ago. Started a huge refactor the first week in. Then, a bigger refactor the second month in. I feel I've already earn my credentials with these 3 refactors.

The directors and the team leader appreciate the honesty and my initiative to make the codebase healthier.

Like Ray Dalio says, 'don't tolerate shit'.

P.D: I rewrote a huge section of the application on Vue2 with SFC's. The other three developers who wrote backend mostly, tried to do the FrontEnd, but made a complete mess.

Re: Ask HN: Codebase at my work is a complete mess, what should I do?

#307

Earlier quoted context omitted.

They didn’t even have a look at the code. Their task would have been to write and maintain end-user documentation and they left before they even had computer and stuff set up. Just never came back from lunch. Said they’d not feel up to the task. I was just a student at that time, so I can’t really say if that was a hiring fuckup or just an odd person. Certainly one of the weirder things to witness in my career.

Most likely explanation is that this person received a better job offer and did not wanted to let your company know.

[deleted]

Re: Ask HN: Codebase at my work is a complete mess, what should I do?

#308
Gamedev.

I joined a small company 8 months ago. The code at first felt somewhat sane, but the more I worked with it the more I understood that the whole project is a huge copypaste mom's spaghetti. I started rewriting everything I "legally"(somewhat within the scope of my tasks) could. I also kept asking the lead coder about the poor quality and poor decisions up to the point where all we did was argue. Management saw this and it turns out they were not satisfied with his performance for quite some time. He gets kicked out(after 4 years). During the 8 months I have deleted 1/3rd of the whole codebase, replacing it with much better code both quality and performance wise. I did that because I don't want to spend the next couple of years suffering from someone's bad decisions and complete lack of experience. Now I get to work on much more interesting tasks, everything gets delivered faster. Some of the stuff I wrote gets used across other teams. Only things that still keep me getting stuck in debugger are those I haven't rewritten and everyone agrees we have to rewrite them in near future.

I know I made a risky decision, but it was well worth it.

Re: Ask HN: Codebase at my work is a complete mess, what should I do?

#309

I've been on both sides of this issue in the span of my career. I've joined companies with absolutely horrific code, and I've hired people who thought my code was shit. My advice is don't complain and don't attempt any significant rewrites for the first 6 months or so. Your job at first is simply to understand the code and demonstrate that you are able make improvements to it without breaking everything. Doing so wil…

That 6 months is also a great opportunity to establish a test suite. It's dangerous to tell management that the code is bad. It's not dangerous to say that it needs tests, since that's an industry best practice and there are objectively no tests, and that you believe that a certain amount of your time needs to be devoted to paying back some of that testing debt. Then, when 6 months rolls around, you either have the confidence to do a major refactor/rewrite or leave and give the person who comes after you the test suite necessary to do the next step.

Plus, to my mind, there's no better way to start understanding a new codebase than to start with tests, either writing them or reading the existing suite.

Re: Ask HN: Codebase at my work is a complete mess, what should I do?

#310

Earlier quoted context omitted.

Thanks for sharing this. Venting is good, and in this case a win-win, since this is good info (very relevant in a thread about encountering "bad codebases"). Hopefully OP sees it. You could well be "the other developer" where OP is. Open question: how does one fight against what's been described in this comment? What specific sorts of communication skills? One thing that comes to mind is learning when and how hard to…

You really can’t, it’s not productive to assume this a skill you need or is beneficial (although it can be) and if people pick up your code and joke, laugh, or belittle without context, as in this case, it’s not your fault, don’t let it effect you. You’ll find the vast majority of developers are childish and immature, and not very good at their jobs, that’s been my experience at least.

Right, duly noted.

I'm actually speaking completely generally though; I'm falling apart at this universally speaking. Perhaps I just need to learn how to debate?

When I'm presented with a context in which I need to prepare any sort of defense, 51% of my brain will sometimes go silly, and I'll get really anxious and irrationally fearful and tense up. Things rapidly go south from there; the biggest side-effect is that my memory completely shuts down, meaning that I cannot remember a) any of the things the other person said (so I cannot form an effective defense), b) any of the things I said (so if I say something incorrect[ly] I won't remember) and c) the way I say what I say, which means that my tone of voice might be off and I'll basically be too spaced-out to notice. The resulting arguments are almost comical in their narrow-focusedness, with the resulting back-and-forth many many degrees away from whatever the original point was (which typically gets lost within the first few seconds of conversation).

This is probably due to autism and some related undiagnosed anxiety disorder, but labels aside I've never really known where to start tackling something like this. I've given up on mental health support, which only has its own agenda (I don't want the brain-fog of drugs, so all the departments could care less), I just want to brain-hack my thinking onto the right track and I've no idea how.

FWIW, this is one of the reasons I'm actually reluctant to get a job, so I'm yet to get practical experience dealing with real-world issues.

Post reply on HN