Skip to content
PodSubs
ShowsPeopleGuestsJobsNewsEvents
More
BlogPodCred
Menu
ShowsPeopleGuestsJobsNewsEventsBlogPodCredNetworksSign in
Join nowSign in
  • Shows
  • People
  • Jobs
  • News
  • More
    • Guests
    • Events
    • Blog
    • PodCred
    • Networks
    Join nowSign in

DevQuestions with Tim Corey

DevQuestions with Tim Corey artwork

265. Technical Debt Is Not What You Think It Is

Jul 3, 202518 minAudio

How do I eliminate technical debt? Why does every company have so much technical debt? Why don't developers focus more on writing good, clean code? These are the questions we will answer in today's episode of Dev Questions. Website: https://www.DevForge.com/ Ask Your Question: https://suggestions.iamtimcorey.com/ Sign Up to Get More Great Developer Content in Your Inbox: https://signup.iamtimcorey.com/

Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.

Transcript

From the show. Tap a time to play from there.

SPEAKER_01Everyone complains about technical debt. When you join a new company, the first thing that will probably overwhelm you is the code base and how ugly it really is. A real working code base almost never looks like what you would see in school or in demos. It's rare to see a project that follows best practices, is written with clear, understandable code, and that is consistent throughout. Instead, it's often a jumbled mess of hacked-together systems that don't follow solid, dry, or implement most design patterns.

SPEAKER_01Every company has technical debt, but it often has little to do with how their code is written. So let's talk about what tech debt really is, when it's okay, and how you can reduce the harmful effects of tech debt in today's episode of DevQuestions.

SPEAKER_00Welcome to the DevQuestiPast with Tim Corey.

SPEAKER_01Software development is more than just writing code. So let's talk about the rest of it. Specifically, let's talk about technical debt and how to navigate it. And let's start with a definition. Ward Cunningham came up with the phrase technical debt or tech debt to describe the deliberate trade-offs of software development, getting a benefit today in exchange for a cost down the road. It isn't necessarily about bad code. As a developer, we work within constraints.

SPEAKER_01Those constraints force us to make prioritization decisions. Do we launch today or do we wait a week and add unit testing? Or do we add this feature or fix that bug? One way we incur technical debt is by moving faster, knowing that we'll have to pay the interest later. For example, I saw a company push a product to production before they had the ability to handle recurring billing. They knew they had one month to figure it out before they had an issue.

SPEAKER_01By doing it this way, they incurred tech debt, including forcing themselves to create a feature quickly and they made it more difficult to implement because they'd already have live customers in the system. But they were able to get their product to market that much faster. So they chose a trade-off and they chose tech debt intentionally in order to get the benefits, even though there was a cost associated. So let's talk about the various types of tech debt, how to identify their root causes, and then what to do about them.

SPEAKER_01Number one is sloppy code. You've all seen this, code that is just poorly written. It seems hasty, it seems messy, it seems like they really didn't care about the craft of writing software. So what's the cause? Well, here's some major overarching themes you'll probably see when you see sloppy code. Poor process. That's probably the biggest one. So they don't do code reviews, or they do code reviews poorly. They have a lack of shared conventions, or they have poor training.

SPEAKER_01So these systems are more about people and processes than they are about the code itself. You see, if if a person writes sloppy code and it gets pushed to production, what had to happen for that to be the case? Well, they had to write the sloppy code, which means they may be poorly trained and don't understand how to write good code. But then the person that did their code review, if they have the code reviews, looked at that code and went, yep, sounds good, and sent that to production.

SPEAKER_01So they don't have a great process for code review. And or that person that created the code, well, they did things the way they thought was the right way, but that conflicts with somebody else and how they thought was the right way. And therefore, what they really need was a common set of conventions that they both follow or they all follow. So what's the solution? Improve the process. You don't just improve the code, that's a symptom, not the actual root problem.

SPEAKER_01The root problem is the process. So in improve the process. What that might mean is it might mean just having a better training system in place where you once a month sit down and train up your whole team on here's how we do things. Or maybe it is a better onboarding process for junior developers and interns, where you walk them through here's how to write good code with some regular check-ins. Or it might be implementing a code review process so that prop that code isn't just sent to production without another set of eyes looking at it and reviewing it.

SPEAKER_01And that code review, it's important how you do it. Code reviews shouldn't just be a let's format this differently. That's not the purpose of a code review. There's so much more to it. We'll talk about that later. But making sure you have the right processes in place to improve the quality of code is a solution. Not just yelling at one person or just complaining about the fact that your code is bad. Okay? It's fixing the process first and the rest follows. Now, number two, a tech debt you might see is workarounds, hacks, repeated code.

SPEAKER_01The code base is filled with these shortcuts to get the code working. And you see, well, you know, if you'd spent a little extra time, you could have made this repeatable. You could have made this better for everybody instead of this workaround. Or you see hacks in place that might even say slash slash hack. And they might say, this is a hack. I know it's a hack, but it works. So what is the cause of this? Well, the big one will be tight deadlines.

SPEAKER_01So when you have rushed features, when the the boss is breathing down your neck saying, I need this out the door tomorrow, even though you know you've got 15 hours worth of work to do in eight hours. Okay, so what you're doing is you're rushing, you're getting things done quickly. You're you're throwing things against the wall. If it works, it ships. And you're just trying to get things in place. Now, every company does this. And part of the reason why is because developers forget why they are there.

SPEAKER_01They aren't there to write beautiful code. They are there to write code that accomplishes a job. And so the non-technical people, the people that are asking for the changes, what they're saying is we need to do our job better. And you need to help us do that. And we don't really want to hear about the bug fixes you did or the way you re-optimize the code base. We don't care. What we want is the thing to do our job better.

SPEAKER_01So there's always going to be some of that in organization, you can't just eliminate it. But there are solutions to this tech debt problem. And one of the solutions is clear cause and effect communication with leadership. Last week we talked about talking to non-technical people. This is especially the case in this particular tech debt. Because when you don't communicate clearly the cause and effect of a particular issue, when you don't say, hey, we can absolutely do this, we can get this out tomorrow.

SPEAKER_01If we do, it will cost us an extra week of bug fixes. Or if we do, we risk these issues happening. If you don't clearly communicate that, then the person making the decision, the non-technical person, isn't going to take that into account. And they're going to say, I want that feature. And if I can have it tomorrow, I want it tomorrow. So having clear communication will help reduce some of these. It does not mean it will eliminate them, but it's going to improve things.

SPEAKER_01So the other part of this is to add in time donation systems. Now I call it time donation. That's just a term I made up. But what I'm talking about is that when you're working in other projects, not every project has a deadline that's immediate. You have to get it done now. Now you always have to work fast, but there are pockets of time that you can work in, especially if you put into the schedule of every project you can extra flex time, which you should already be doing, but put even more in.

SPEAKER_01And then what you're going to want to do is bring those features in into production quicker than the expectation, which is going to benefit, but also save some time in there, some of your extra time, take some of that, and go back and fix some of the tech debt problems caused by those rushed features or tight deadlines. So you go back and fix some problems on your own or using the budget of somebody else. Okay. So this is like if you're working around your house and you just have to get the lawn mowed and you rush around, you mow a lawn, but you didn't trim.

SPEAKER_01And you got the majority of stuff done and it it works. But if you can take the time where maybe you have another project like sweeping a sidewalk, well, you could trim and sweep a sidewalk in that time and kind of donate some of the sweeping time to trim and sweep. That way you are kind of picking up the slack where you can. So you're not going to eliminate tight deadlines. You're not going to eliminate rushed features.

SPEAKER_01But by clearly communicating the cause and effect, that will help. And then also donating time from other projects or other places to going back to fix those issues will also help. Number three in our tech debt category is misedmatch conventions or different technology versions used in a project. So you come into a project and you realize hey, part of this is written in.NET framework, but then we've got.NET standards from other places and.NET Core and other places, and we've got these various versions of things.

SPEAKER_01And we started off with win forms. It looks like they've upgraded parts of it. And you've got this whole process of different systems, maybe different versions of a language. Maybe you use microservices. And some microservices are on.NET 5, and some are on 6, and some are on 7, some are on 8, some are on 9, some are even on the preview version of 10. And you're like, man, this is a mess. What's the cause of this? Well, the cause is actually the evolutionary nature of software.

SPEAKER_01Your software is going to evolve over time. And whenever you have an application that lives for more than a year, you're going to have some of this evolutionary nature. Now, ideal would be that everything is on the latest version, that's an LTS version, at least, if not the latest version, and that you're always keeping all your dependencies up to date and you're always keeping everything at the latest supported version. That's the ideal. The real world's not ideal.

SPEAKER_01The real world's messy. And you're going to find various versions throughout your application. You're not going to be able to upgrade everything. It's going to be a bit of a mess. So what's the solution to this tech debt? Well, this isn't really debt. It's just the nature of the progression of age of an application. Now, yes, again, ideal would be move everything to the latest version, but this is the nature of how an application grows over time. And there will be natural stopping points, points where you just can't move forward, at least not without an incredible expenditure of time and effort.

SPEAKER_01And those aren't necessarily possible in most organizations. And so you're going to stop. I worked with somebody, I lamented with him as he explained how he was still on.NET Framework 3.5 and couldn't get off it because of some of their hardware. And yes, that's going to happen. And yes, that's frustrating. And who wants to work on.NET Framework 3.5 applications today? But that's going to happen. And that doesn't mean that all their new applications, all their applications that interact are going to be.NET Framework 3.5 too.

SPEAKER_01They'll be different versions as they're able to progress different parts forward. And that's just the nature of software development, especially with an application that is mature and large. So it's not really a debt. If you can improve it, that's great. But it's just something that you have to live with as a feature of software development. Now, number four in the category is poorly performing systems. So I see this one a lot where the application is in production, it's been used for a couple of years, and the team is just starting to see some bad performance.

SPEAKER_01I was a consultant for a number of years, and I would come into companies to help them with these exact situations. And I found there were some key things that they'd all done in a similar manner, especially since how I was working with things. One of the big ones for me was entity framework. I saw entity framework was the cause of a lot of these performance. Now I say cause, it's not really the cause. The real cause was a bad understanding of how to implement entity framework, which is why I say entity framework is a great tool, as long as you know how to use it well.

SPEAKER_01So what's the cause of these poorly performing systems? Usually bad architecture or bad design decisions. So when the team was building the application, they had a misunderstanding of how to build an application that would scale to where they would eventually be. So maybe they worked great in development, it worked great with hundreds of customers. But once they had tens of thousands of customers, it didn't work so well anymore. And that's a difficult place to be because the tech debt is based upon the fact that you built your system on the wrong foundation.

SPEAKER_01You started with a wrong platform and started building off of that. And again, that doesn't have to be the technology, it could be how you structured that technology. So what's the solution? The solution is often to make the best of it. You can't say fix this. This is why companies need, not just want, but need to have good technical leads or good senior developers that help them make good architectural systems, good architectural designs.

SPEAKER_01This is why experience matters. Because when you have built demos, when you have built small apps, when you have built a couple of things, you have not seen the end result of these choices over and over and over again to go, oh, we don't want to do this this way. We don't want to do that that way. We want to make some tweaks here, some changes to make sure that we can scale in the proper way, to make sure that the decisions we make today aren't going to harm us tomorrow.

SPEAKER_01Because often you can't just go back and change out the whole foundation. That's just not something you can often do. When you're building a house, if you put the house on a bad foundation, ripping it out and replacing it is almost impossible. It causes massive issues, and sometimes it's just not worth the cost. The same is true in software development. So sometimes tech debt is going to live with a company almost forever. Sometimes the tech debt will live as long as the company does.

SPEAKER_01And so you are careful that you don't take on decision making in a way that you're not really familiar with, or that you're just following along with what somebody else says and don't know why. You need to understand through experience. And that experience comes through building things. Because in this category, the solution is just make the best of it, optimize as best you can, rewrite what you can, and just make it as efficient as possible, but know that it will never be as efficient as it could have been had you built it on a different foundation.

SPEAKER_01So not all tech debt is created equal. And every system is going to have tech debt. We don't live in a perfect world. We live in a world where we need to make trade-offs every day. The key is to understand, understand this idea of making trade-offs and that not all tech debt is created equal, and then make the right trade-offs. So thanks for listening. And as always, I am Tim Corey.

SPEAKER_00Thank you for joining us for this episode of Dev Questions. When you're ready to learn to think and code like a professional developer, head over to imtimcorey.com and enroll in a course.

Open the transcript file

Hosts and Guests

Nobody is credited on this episode yet.

Credit the people on this episode

Be the first to rate this episode

More episodes

All episodes
  1. 334. Is Entity Framework Still Relevant When AI Can Write SQL?

    Nov 5, 202614 minAudio

    Entity Framework and other ORMs write the SQL for us. But are they necessary now that AI can do that work? Is the overhead of EF on every query worth the limited benefits we now get at design time? Do ORMs still make...

    Credit the people on this episode

  2. 333. Why Boring Technology Wins

    Oct 29, 202621 minAudio

    Why don't companies use the latest frameworks and systems? Why is .NET Framework still used in companies? Why don't companies follow industry best practices in their apps? Why can't I use the latest tech at my software...

    Credit the people on this episode

  3. 332. What To Do When You Are Burned Out

    Oct 22, 202628 minAudio

    What do I do if I am burned out? How do I get through burnout? How do I get to the other side? How do I endure my job and my situation while experiencing burnout? These are the questions we will answer in today's...

    Credit the people on this episode

  4. 331. .NET 8 and .NET 9 Both Expire Next Month: Is LTS Still a Thing?

    Oct 15, 202613 minAudio

    .NET 8 is the LTS version of .NET, but it expires next month. Why? Why does .NET 9 expire at the same time as .NET 8? How does LTS work with .NET and why is it so short? Do these versions stop working next month? Why...

    Credit the people on this episode

  5. 330. What To Do When Someone Pitches You An App Idea

    Oct 8, 202621 minAudio

    What do I do if my friend wants me to build an app? How do I evaluate if an app is a good idea? Who should own an app if one person has the idea and the other builds it? How do I say no to an app idea? These are the...

    Credit the people on this episode