DevQuestions with Tim Corey
I am Tim Corey. I teach coding online and my inbox is full of questions from current and future developers. I wish I could sit down with each of you and share the answers I know will help you go further, faster in the world of development. This podcast is the next best thing. On this podcast, I will answer the biggest questions people are asking! Send us to your suggestion for a future Dev Questions at https://suggestions.iamtimcorey.com/ To keep the podcast coming, like, subscribe, rate, and share it with your friends and colleagues. See why thousands of students have chosen to learn to think and code like a professional developer at www.DevForge.com.
DevQuestions with Tim Corey
162 Why Do Applications Need Constant Updates? What is Code Rot?
Use Left/Right to seek, Home/End to jump to start or end. Hold shift to jump forward or backward.
Why can’t companies stop updating an application once it is complete? Why are they constantly making changes? How can code rot when no one is making any changes to it? We will answer these questions in today's Dev Questions episode.
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/
Welcome to the Dev Questions Podcast with Tim Corey. Join us each episode as we tackle the questions you are asking about a career in software development, understanding the industry, and new technology. If you're just starting out or you want to grow stronger as a developer, this is the place to get your questions answered. Now, here's your host, expert developer and online educator, Tim Corey.
SPEAKER_02Why do applications need constant updates? And what is code rot? This is a question that came up on the suggestion site, and it's one I want to tackle in today's episode of DevQuestions. Now, if you have a question, go to suggestions.iamtimcorey.com, leave your set your suggestion, your comment there, or your question, and also upvote others that you think might be important as well. And hopefully you'll see your question answered in a future episode of DevQuestions. So what is code rot? What's the idea that, like why doesn't why doesn't an application just continue to work over time? So applications don't freeze in time. You may think, well, you know, back in back in the day, you used to have CD-ROM drives where you had CD-ROM disks that you put in that would be the application. And I bought a lot of games that way. I have a whole bin still of games that were on CD. And I can't just put them in the computer now, even if I can dig out a CD-ROM drive, I can't just put them in and hope for them to still work. Or at least not mostly. They may kind of work, but it's going to be a little clutchy at best. So why is it they were great when they first came out, but now they're not? Because the code didn't change. Well, that's true, but there's an important point here. The world is always changing. So when you think about the world, when you think about software development specifically in the world, think about the fact that operating systems change over time. And you may say, well, yeah, but they shouldn't. They should always be, they should stay where they are. Yeah, except for the fact that you also want all those features you want, right? But even that, there's operating systems and they change over time. But so do browsers. And those things are changing not just because of new features, but also because viruses and malware are changing and growing over time. New exploits come out, new uh holes are discovered in the software. Things have to be patched and changed. But there's also new platforms. I mean, recently Apple came out with their AR slash VR headset. Well, that's not something we had 10 years ago. And now we have things like the Rift and the Valve Index, and now this new vision application or Vision OS and the Vision um uh tool from Apple that's gonna come out at some point. Um that's a new platform. Uh phones. We didn't used to have applications on phones or tablets, but now we do. Now we have foldable phones. Now we have there's new platforms coming out all the time. New hardware. So the the hardware your computer runs on probably isn't the same hardware you had 10 years ago. And if it is, it might be time to upgrade if you can, okay? Because things have changed. And there's also that idea, that driving need for new features because we want new stuff, right? The internet wasn't really a thing when I was graduating high school. It was kind of a thing, but it was a tiny thing. It was a thing that was just starting out in the normal everyday home. But now it's, you know, it's on your phone, it's on your tablet, it's on your laptop, it's on your desktop. And with that comes new features, new things you want to do. I didn't have things like Microsoft Teams or Zoom when I was graduating high school. But now it's kind of a normal thing. That's because new situations in the world drive new features as well. So, with all those things changing, what does that mean for your software? It means that your software needs to continue to grow and change just to stay in place. So even without adding new things or growing what it does, you need to make changes just to keep it in place, just to keep it current and modern and able to run the way it does today tomorrow. Okay. So let's bring us down to a C sharp application. Let's say you build a C sharp web application, maybe a Blazor server application. Okay. All right. The NuGet packages you rely on are going to have updates. Now, some of those updates might be new features. Maybe you don't need those. But you need the security fixes they also bring, the bug fixes they also bring. Otherwise, you can be leaving yourself open for security flaws. And those upgrades also bring speed, and you probably want those speed improvements as well. So you probably need to keep those NuGet packages up to date. And then.NET versions change over time. Well, but if it worked today, why shouldn't it work tomorrow, right? Well, but things do change, and part of that is they are saying, hey, we're going to apply these security fixes to the.NET runtime. Well, if you were on.NET 5, well, that only had 18 months or 21 months of support. So you need to move on to.NET 6, which had three years of support. But that's coming to a close when.NET 9 comes out-ish. So you got to keep moving forward in order to keep getting those updates. And that's important. Microsoft's really trying to help you with that, even though it says, oh man, I wish they wouldn't, I wish they'd let me stop and slow down. But if they do that, then you don't get the features you want. And there are people on older and older and older versions that are falling behind with their NuGet packages too, and with other things that are also leaving them vulnerable. So it really is important to keep moving forward just to stay in place. And then, okay, so you have NuGet packages that need to be updated. We have.NET versions that need to be changed. But then your UI needs to be reviewed pretty constantly. Because again, things change. It used to be the browser, if you're going to be on a web, the browser on the desktop was the thing. Internet Explorer 6. That's where everyone was, right? Until we started to have some growth in the market and things that Microsoft didn't squash. You know, things like Firefox and then Chrome. And all of a sudden, now, instead of being Internet Explorer focused, the world is kind of Chromium focused. And with that, all those things that worked on Internet Explorer don't work the same way on Chrome because, well, Internet Explorer wasn't Internet standard. But Chrome, for the most part, is. And so you really should be updating to the Chrome. So it works on Chrome, but not just Chrome. It has to work on Firefox, it has to work on Opera and all these other things that come out. Then Brave comes out, and then other things come out. DuckDuckGo comes out with a browser, and all of a sudden we have all these different things we have to support that weren't there when we first brought our user interface out. We need to try these things and test these things, make sure they work. Maybe it's just a screen size itself, where we design it for that desktop. But then along comes your phone. That's a lot smaller. Does it still work? His website is real old school. It's designed for a desktop. And really a desktop running Internet Explorer. So things don't work quite right. And definitely not web standard, but also when I go to my phone, I have to zoom, zoom, zoom in order to get to see anything. And it's really touchy how it works. So actually coming back to it and saying, oh, we need to actually make this work for the phones. And then tablets and then foldable phones and different size screens with different height requirements, ultra-wide monitors. You know, some websites said use the entire width of the screen. That's great, as long as you have a 16 by 9 or 16 by 10 monitor. But what happens when your monitor isn't ultra wide? Well, all of a sudden, you have instead of a nice little paragraph of information that maybe is, you know, three, four lines, maybe five lines of text, now it's one line of text that stretches across 50 inches of screen. That's not a great look. So you have to figure out how to make that work in the new user interface or new layout. So you need to review your user interfaces. And you know what? Where you put your data, that needs updates too. Security changes happen, features have to be added, and improvements to the performance have to come in. So you have to update that as well. So if you update your database, you might have to update your data access layer, which might mean your user interface layer as well. So all these things conspire to make you need to move forward all the time just to stay in place. It's important to do so. Otherwise, if you say, nope, I'm gonna stop right here, it's kind of like you're the old game on a CD-ROM. Well, all of a sudden, that was great in the day, but now it can't reinstall anywhere. It doesn't really work anywhere. You have to have special hardware to get that to work. It's kind of useless and something else will take its place. So what if you don't upgrade? Well, you don't get patches for vulnerabilities. This is a really big one. If you're not getting patches for vulnerabilities, vulnerabilities that have been known about for years aren't fixed on your application. Now, people who you know maybe even have no clue how to be a hacker can just go to a forum and say, oh, look for this or try this, and anything that hasn't been upgraded is still vulnerable, that would be you. So you don't get those patches. And then you also don't get to always work on the new platforms. Maybe it worked on the desktop, but it doesn't really work on the phone. So you just don't have a presence on that device now. And it doesn't always work with new hardware. Maybe a new video card comes out or a new way of doing rendering video comes out. You can't be on it. So now all of a sudden, you can't work on that new platform, that new hardware. You don't only get to work with new browsers. Maybe a new browser comes out and it doesn't work for you. So maybe you don't get to find the people that you want to maintain your project. Because, okay, you built the project, you it's been, you know, you've added features to it, but not really upgrade it ever because it's it's too hard. So now all of a sudden you're on.NET Framework 3.5. And the people who are coming into the market, the newer developers, want to be on.NET 6 or.NET 7. And you can't entice them to come to.NET Framework 3.5. And so you have to look for people who've been around for a long time. And you know what? They're starting to retire. They're starting to go, no, I don't want to do that. I want to do the new stuff too. So your market for prospects for new people is dwindling, which means you either have to pay more or do with less. And so it makes it harder and harder to maintain your application and add those new features. And maybe you say down the road, oh, you know what? Yep, I think I need to upgrade. Might be too late because it gets harder and harder as you go when it was little baby steps over time. And don't get me wrong, every upgrade can be difficult. I'm not minimizing that. But an upgrade from.NET 5 to.NET 6 isn't that big a deal. But it is compared to from five to let's say eight. That's a bigger deal. And by the time 12 comes out, it'll be a really big deal. So taking it one step at a time will allow you to make smaller changes over time. And if you wait, it's getting a lot harder to make that move, which means you have less and less opportunity to do that. So just like building a building, you always need to consider the ongoing maintenance of software as part of the cost. I worked for a university and at one point they were building this large new building. And they had barely the budget to build the building. But they didn't really have the budget to maintain the building. And they said, well, but it's a brand new building, so we can kind of get by that for a while. But the reality is, even day one, there's going to be some costs associated with maintaining something. I had a friend who was renting and he said, Man, I would love to buy a house. And you know what? If I bought a house, I could save two or three hundred dollars a month in rent. And I looked at him and said, you know what? You're probably better off renting. Because that $200 or $300 a month isn't going to cover the maintenance. Because when your water heater goes out, or when you need a new roof, or when you need a new boiler, these things are going to cost a significant chunk of money. And even a year's worth of saving of $200 a month, that's only $2,400. That's not really enough for a new roof or a new heater. So there is going to be cost for maintaining. The initial purchase cost is not the only cost. And that's true with software development too. The initial cost of building the application is not the only cost. There is an ongoing maintenance cost just of maintaining the status quo, just of maintaining upgrading the NuGet packages, updating the version of.NET, updating the UI to work with new platforms, fixing the bugs. These things, there's a cost to it. And so you can't just say we're going to build this and move on. Build this and move on. There has to be some ongoing costs planned for. Otherwise, you're going to get into a spot where you just can't afford to keep going and your application is going to start to die. So that's my advice here. I think that it's important to count the cost before you start because code rot is a real thing. Applications do require constant updates just to maintain where they are. And if you just add new features and don't work on maintaining the system, it will degrade over time, just like any building will, or just like any other thing will, if you don't properly maintain it. So I encourage you to think that through when you're building an application and think that through when you're maintaining an application and make sure that you're not just saying maintenance is adding new features. But maintenance also has to be updating the NuGet packages, updating the frameworks, making sure that it works on all the same devices or new devices as well, and making sure that it at least maintains where it's at in the ecosystem so that it's continually a valid and viable application that is safe and secure for your users. Okay, I hope I answered your question. Thanks for listening. As always, I am Tim Corey.
SPEAKER_01Thank you for joining us for this episode of Dev Questions. Tim is committed to making it easier for you to become a developer. If you would like to help make more content like this possible, please like, subscribe, rate, and share Dev Questions. You can also send your questions to questions at IamtimCore.com. Until next time, remember, you are too smart and your time too valuable to waste it making all the mistakes Tim did. When you're ready to learn to think and code like a professional developer, head over to imtimcore.com and enroll in a course.