Live data from Hacker News

Ask HN: Does every software project require a refactor?

news.ycombinator.com

1–10 of 13 posts

Re: Ask HN: Does every software project require a refactor?

#2
Because the requirements change, the performance characteristics change, and the people change. But even if none of that was true the technology landscape changes (e.g. Angular 1.x to Angular 2.x+).

If you show me a project that couldn't benefit from a refactor, then you're showing me a project that is effectively EOL sooner or later.

Re: Ask HN: Does every software project require a refactor?

#7
Yes. Continuously.

There's 3 times to refactor:

1. When you're trying to add a new feature ("prepare").

2. When the new functionality has been added ("tidy").

3. When you're trying to understand the code ("clarify").

The problem is when refactoring is seen as a separate activity from coding. It shouldn't be: it is a _part_ of the coding activity.

Re: Ask HN: Does every software project require a refactor?

#8
post #6

Require? No. Could use one? Yes. Every project could use refactoring, at all stages.

“Premature optimization is the root of all evil”

https://effectiviology.com/premature-optimization/

IOW, don't waste time in refactoring if it is not imperative for some particular reason.

Re: Ask HN: Does every software project require a refactor?

#9
post #6

Require? No. Could use one? Yes. Every project could use refactoring, at all stages.

“Premature optimization is the root of all evil” https://effectiviology.com/premature-optimization/ IOW, don't waste time in refactoring if it is not imperative for some particular reason.

100% agreed.

Re: Ask HN: Does every software project require a refactor?

#10
Except for a small set of programs where the specification is completely defined (think mathematics) every software system evolves according to a well-known life cycle. It changes continuously to address new and evolving external world requirements, its structure degrades and becomes more complex and difficult to maintain unless work is done to maintain or reduce it.

Because you phrased it as "eventual refactoring", I'm going to take your question to mean that at some point in the lifecycle the codebase becomes too complex and degraded for a team to work on. At that point, the choice is to either fix it or replace it.

But well-maintained codebases undergo continual refactoring, which counters the decay and trend towards excess complexity. Look at things that have been in use for a long time. The Apache http server has been around since 1995, with only the release 2.0 introducing wide-ranging changes. Linux began in 1991.

In short, if the team, for whatever reason, neglects the effort to maintain the quality of the codebase, then yes, if it continues to be in use, it will need a comprehensive refactoring, or replacement.

Post reply on HN