4 ms·
It’s a useful way to frame things in technical discussions. Everyone wants to refactor ugly code, but unless the team is paying interest because the code is ba
by Retric 5y ago
It’s a useful way to frame things in technical discussions. Everyone wants to refactor ugly code, but unless the team is paying interest because the code is bad it’s rarely worth it just because.
Aka if it’s 5 years old and nobody had needed to edit it then yes it’s ugly but the interest rate is probably low. Meanwhile stuff that just a little off but gets touched every week can be much more meaningful.
- errantmind 5y agoI don't think it is at all useful in technical discussions as it anchors the discussion in backwards reasoning (deduction). Better to start with real observations about the workings of a particular piece of software or architecture, then reason about why it may have certain 'bad' properties. This more often leads to action and mutual understanding, but requires actually putting in some mental effort. In your example, calling some code 'ugly' is another example of what I'm saying not to do, it is starting at a conclusion and reasoning backwards. For an example of what I'm advocating, say you started a project and defined certain architectural principles after a series of discussions with stakeholders. Let's say one of those principles is efficiency/speed of execution because the stakeholders use the software synchronously. So, that is how you define code quality in that project. You benchmark and eliminate hotspots until you reach acceptable performance. Independent of context, fast code may appear ugly to some people, but in this context it is not, perhaps it is even beautiful as it so embodies and elevates the architectural principle it was designed around. Developers now have a frame to surface issues and everyone can agree on what an issue is, because you defined what an issue looks like and why it is important, up front, as one of your architectural principles. This is basically a context-bound value system. There is no need to even use the words 'technical debt'. In a real project you have multiple competing architectural principles but these are prioritized so you know how to evaluate whether or not something is 'good' or 'bad'. As a project leader I believe it is your job to define these architectural principles, to enable developers to frame 'good and bad' as well as to prioritize their work. I used this approach when leading a project and it was very effective.
- Retric 5y agoIf your code isn’t fast enough to meet spec, that’s just a defect. QA should create a ticket even if you don’t. There are however a meaningful class of issues that have zero direct impact outside the team, but are still issues for your team. The best example of that is how long it takes to setup your build environment, frankly your users have zero reason to care but it can still slow your teams progress over time. Really the cost and payoff of fixing it is simply time / a better work environment. Different teams will of course use technical debt to describe stuff outside of that context, but if it directly benefits users then it’s really something else.
- chinchilla2020 5y ago> ugly code Ugly code doesn't cause issues. Refactoring a reliable, functional, easily maintained codebase because it isn't elegant (or 'beautiful') is a waste of time.
- Retric 5y agoI think you’re describing something else. The defining characteristic of ugly code is it’s hard to reason about and thus not easy to maintain. It can still reliable, functional, and ugly.
- dilyevsky 5y agoPeople (myself included) usually overestimate their ability to ship more readable code that has bug-for-bug parity with complex existing codebase.
- Spivak 5y agoI think step zero for this kinda thing should be writing a test suite using the current code as the reference implementation. Then you spike it out with a first pass and if your clean version can’t get 90%+ without lots of edge case handling or abstraction breaking then you keep what you have.
- dilyevsky 5y agoThat’s exactly my point - chasing that 10% remainder will make the new thing similarly hacks-ridden as the original
- Retric 5y agoI think you’re getting at a deeper issue. The need for bug-for-bug parity internally is itself a sign of technical debt. At this point we can’t for example fix historical calendars, so all highly accurate date and time related code is going to be complicated and full of edge cases. Such code is in effect an interest payment on society’s existing technical debt. So, the temptation to refactor such code is generally attacking the wrong side of a problem. The best approach may be to quarantine such code/systems and try and minimize the impact of such issues.
- mmcnl 5y agoWhat is the impact on the end user? Will anyone notice or care if you don't address the technical debt?
- Retric 5y agoIn the platonic ideal of technical debut it should have zero direct impact on users. Indirect impacts are a slowdown in the release of new features, and or bug fixes etc.
- mmcnl 5y agoImpact is impact. Slower roll-out of future releases is already way more specific than a vague arbitrary term "technical debt", right? I challenge you to come up with a situation where technical debt is a better way to describe activities than indirect impact as you are doing here.
- Retric 5y agoHow about someone saying “The X has _.” For one it’s more specific. Saying the existing code has indirect impact doesn’t even define if it’s a good or bad impact. If you want to say, the existing code has long description that just means technical debt then sure they mean the same thing but the term technical debt is more concise. You can still add all the low level details, but redundancy in communication still aids clarity.