I've been on teams pushed to create feature after feature. After some time, we literally begged to refactor code. We begged to do what was best for the company. Guess what? They didn't listen and new features became painful to implement. Of course some of us refactored code on the down low, but this is dangerous (they aren't fully QA'd or reviewed) and kind of insulting to have to sneak around doing the right thing.
For me hearing a company refactors its code is refreshing.
What I don't get is the mindset that refactoring is optional.
If I'd be the customer and people came to me to tell me "Of course we can do feature X but we also LIKE to do Y" what I hear is "We can do what you want for amount EUR x but we'd like to sell you something that costs EUR x+k".
So I'm not talking about the customer believing it's optional, I'm talking about the development teams themselves believing it's optional.
I't would sound a whole lot different to state "Sure we can do X. It's EUR x. This is what is necessary..." (the list of work packages would include refactoring, maybe worded in a way that is better understandable by my customers).
I'm going to spare you the the usual comparison to car makers or whatnot. I think the mistake is with ourselves to simply state that it is necessary and not optional to maintain quality. After all if you can take the risk of implementing features without maintaining a quality product isn't -- and thus loosing customers as implementing features only when maintaining quality -- and thus loosing customers to competitors who are willing to reduce quality for the other risk, and a possibly lower price for a single project or two?
Imho code that is not touched is not living and cant evolve.
If you consider evolving a part of maintaining, it's really hard to understand why touching code would ever be a bad thing.
In my personal experience team should optimize for confidence - eg explanation, refactoring for confidence, automated tests - without confidence bold and fast moves are not possible.
I've been on teams pushed to create feature after feature. After some time, we literally begged to refactor code. We begged to do what was best for the company. Guess what? They didn't listen and new features became painful to implement. Of course some of us refactored code on the down low, but this is dangerous (they aren't fully QA'd or reviewed) and kind of insulting to have to sneak around doing the right thing.
For me hearing a company refactors its code is refreshing.