I have been working for 6 months as a software engineer in a business where their codebase is terrible, messy code, no tests and many bugs.

Code has basically no comments, everything is piled up inside a single function with nested functions (JavaScript), the code is hard to follow and debug.

When there's some bug fix or new feature, I try to refactor the code of the things I touch.
On my last change, I did a big refactor and they said they want me to remove the code comments from functions because they take space in the source file, and kind of undo some changes, even though it's not breaking anything.

Seems no one cares much about quality, they only want to get things done as fast as possible to deliver to the client.

I'm getting frustrated, and dispirited to work on this code.

My last job's codebase also was bad, but not this bad.

What should I do? Starting looking for a new position somewhere and hope finally I can work with some decent code?

  • The question is what do you want? Is it a no-go for you to work with bad code? Is it a deal breaker? Are you willing to "tolerate" bad code given certain things are met? Do these things are met in your current work or is your desire to leave greater at this point?
    – DarkCygnus
    Commented May 17, 2021 at 19:52
  • 4
    "they only want to get things done as fast as possible to deliver to the client." yet they asked you to spend time removing comments from the code?
    – sf02
    Commented May 17, 2021 at 19:54
  • IMHO the terrible code base is a symptom and not a cause.
    – Peter M
    Commented May 17, 2021 at 20:36
  • Does this answer your question? Team employs bad practices in programming, Should I still stay?
    – Fattie
    Commented May 17, 2021 at 22:31
  • 1
    Who is they? It's a difference if they are colleagues or management. Did they give a reason why you should worsen this code, or did you address the "worsening" effect of removing helpful parts of code?
    – puck
    Commented May 18, 2021 at 6:12

1 Answer 1


One of my favorite interview questions is to ask how a candidate would deal with this situation. Not all code gets to be puppy dogs and rainbows; it's often quite the opposite reality in that the code base tends to be messy, irrational, or difficult to work with!

If all you want to work on is "decent" code, then you're not going to be employed anywhere for very long. As an software developer, you are an expert called into the company to help address the balance between fixing the code base to make it easier to support their requests versus adding new functionalities.

You need to be able to strike that balance, and there's not a lot of guides on the right way to go about doing this. Talking with the customer and setting expectations that the development will slow down because you need more time or resources to deal with the request. If they provide you with neither, then you're going to have to tell them to adjust their expectations (e.g. if they want something done in one week, say you need two or three).

If they're unreasonable from there, and only after you've actually attempted to strike the balance between their demands and the longevity of the application, then and only then should you look for a new job, because you can't work with the stakeholders or the company to find a middle ground.

But until then, don't think you're going to find Nirvana in a code base. It doesn't exist unless you make it. (And even if you make it, it's not going to be Nirvana for quite a long time.)

  • Not even my own code is decent. Sometimes I just need that one thing done and those code are basically bodge jobs.
    – Nelson
    Commented May 18, 2021 at 3:52
  • @Nelson, I agree with the general idea, but the guy in the video used the time he used a Windows KeySend type tool to automate a skydiver's parachute release, as an example. If not for the British accent, I think that would be considered reckless endangerment.
    – Pete W
    Commented May 18, 2021 at 13:18

Not the answer you're looking for? Browse other questions tagged .