HACKER Q&A
📣 zizee

Would you pay for a SaaS product to cleanup dead code?


Sometimes as your codebase grows it is hard to know when parts of your codebase can be retired. This issue impacts dynamic languages like Ruby/Javascript where it can be difficult to statically analyze code for such problems.

I have an idea for a product that would monitor your code as it runs in production with the intent of identifying code that is no longer called. The tool would then open PRs on your codebase to:

1. add tracers to give confidence the code is truly unused, and; 2. remove the code no longer being used.

Obviously, security and performance would be paramount.

Is unused code something that your team is concerned about? Would this be something people would be willing to pay for on an ongoing basis?


  👤 davidajackson Accepted Answer ✓
No because in startups an automated program can't tell the difference between unused code and code that was commented out/not being called. While we would all like to pretend that none of us do this because it's not best practice (especially if we were asked this in an interview :) ), in startups it's common, because there are sometimes more important things to worry about.

You might have more luck building security tools in my opinion--that seems like a bigger implication of unused endpoints, code, etc -- maybe call your potential customers and ask what tools they need around that.


👤 quickthrower2
Cleaning up dead code is equivalent to the halting problem in JS

👤 gitgud
> Is unused code something that your team is concerned about?

Not really, unused code is rarely a problem that businesses care about its unfortunately a user's problem.

I think businesses would care a lot more about code duplication. I can imagine a tool which uses fuzzy matching to find different levels of duplication in a codebase. It might even be an easier problem to solve.


👤 maps7
From a non-tech company pov: no, unused code is not a concern.

👤 pearjuice
Why would I pay for this when my IDE show me this and products like Sonarqube exist which does much more than just checking dead code?

👤 phekunde
I will be more interested in a tool that will reduce, if not eliminate, technical debt :)

👤 alt_f4
Yes, if done perfectly. Then I don't need to second guess it and potentially waste time if the thing removed something important by mistake.

But that's equivalent to solving the halting problem, which is impossible. So, no.