4 ms·
The Half-Life of Code (2017)
- 0x4d464d48 6y agoI've always been partial to the concept of ravioli code which I read about from John Papa. Contained modules that do a job that can be added or removed. You decide whether or not you need that modules fucntionality with no other module having a dependancy on other modules. I agree with the spirit of this article, having a responsive code base with easily replaceable code. But this becomes a problem when you have a code base with sprawling legacy modules with essential functions for core customers that new code must interface with. I worked for a company that attempted to incorporate agile methodology to add features on to a large legacy system to try and stay responsive to customer feedback. The problen was when new features were added we were only adding on to the "cruft" mentioned in the article. As unintentional as it was new code would start to tightly couple with legacy code. In spite of that we kept continuously adding new features with the predictable results of more tech debt, bugs and on-call catastrophes. I'm all for responsive code that instantly reflects customer requirements but it requires a lot of discipline and planning. Ideally, "legacy code" wouldnt exist at all and keeping a low half life should help with that. But in the real world, with people being the irrational, nepotic, lazy and self-deluding creatures we are, thats not going to happen. I'd caution anyone to really know what theyre doing before rationalizing poor design choices by thinking "it's not technical debt if were going to throw the code away anyway!" I'm sure that's what the original authors were thinking when they wrote that awful legacy monstrosity you're dealing with now.
- vvanders 6y agoOver the years one of the most valuable questions I've asked myself as I've worked in long living codebases: "If I had to delete this feature tomorrow how quickly could I do it?" If you come back to this question a few times over development it does a wonderful job of really forcing you to consider your coupling and dependencies. In most cases it's been "delete a few dispatch calls and nuke the whole feature namespace" which has held up very well when future changes come down the pike.
- Wildgoose 6y agoI agree - code should be optimised for deletion. If you can throw code away it is automatically easy to maintain going forward.
- _Franklin1813_ 6y agoYour disks, first example, make you eligible to get all the Half-Life 1 series games for free on your Steam account anyway. Just plug in the key. It was one of the first things they ever did on Steam. They've given them away any number of times. We're talking 20+ year old games, still available on a double-click download, still eligible to redeem your CD-Key for free extra versions online that are updated regularly. And that's precisely it... if you don't support the least-objectionable version of what everyone else has, they have absolutely no incentive to compete with them anyway. You not buying a game, just means you don't have those games. They're not suffering, they have made enough money from Steam to last, pretty much, forever. It's one of the biggest video game incomes to a single company in the world. And... 16 years later my games still work like they did before Steam came along. My account still has all my games. I can install it on any number of PC's I like. I can literally install it at a friends house, sign in as me, play my copy of the game together, and then remove it. I can double-click install and play games I haven't played in 16 years. And I can buy, gift and redeem games through a simple website and get them instantly. I'm only sorry that Steam doesn't do more normal software, I would happily pay for portable, follow-me versions of quite a lot of things I use, but they either have their own crappy ideas of how to do it, or they don't have a similar service at all. I don't care about "friends", or streaming, or their controllers... and they respect that. I have small-mode Steam in my taskbar with notifications off. It stays there. I click it, I find my game in a pure list of games, I play my game, it goes away. Oh, and it backs up my saves/config for me, but that's optional too. Valve are never going to do what you ask... it's their games and their launcher, in effect (that's all Steam is) and it's a damn sight less intrusive than ANYTHING else. I won't even install Origin. The GOG launcher is a mess of huge screens and images when I just want a list. I quite liked the Desura launcher but it went bankrupt, because nobody wanted to buy their games on other services. GOG even match some of my games to Steam, so I get Steam and GOG versions of them. I can't recall the last time I loaded GOG to play a game that's on my Steam. Honestly, Steam gets a bad rap because of silly reasons. Just install it. Put it in small mode. Close it when you don't want it. You will not notice a single difference, except that you don't need your CD, and you can do it on your new computer in ten seconds and a few double-clicks rather than having to reinstall every damn thing all over again. Whatever you're scared of... it's been running for 16 years and still dominates the PC games market, with well-funded rivals. It totally laughed off Games For Windows Live, which was an abomination far worse in scope. EA's bringing their games back from being Origin-only to Steam too because they realized their mistake when nobody followed them. Now it's competing with Windows Store, which is another abomination that I've never seen anyone actually use except by mistake. Load steam. Take it out of your startup if you like. Put it in small mode. Turn off notifications. Redeem your key. Play those games you have, in a far more friendly and simple way. Delete them when you're done. Close Steam if you don't want it doing things on your system. And you can repeat that every year if you like, with everything you put on the account. "If they go bankrupt then I'll lose my games". Yes. Same as anything. And your old CD's won't keep working forever, sorry to tell you this. I can't install Age of Empires 2 from CD and play it any more. You need all kinds of shit to make it work on modern Windows. But I can just double-click on AoE2 (several different modernized versions) on Steam and down it comes and just works, whatever computer I'm on. Honestly... you're not going to go back to the CD era, ever. I'm surprised even GOG have lasted this long. Yet Steam still takes in so much money that it's beyond funny. You don't have to participate in the shit you don't want to... CS 1.6 is still there and unadulterated if you don't like CS:GO, for example (and 1.6 is also free if you have your Half-Life key...) You can either jump from service to service, hoarding your offline copies that will stop working anyway (GOG had to re-do a LOT of work to get everything running on Windows 10, Windows 11, 12, 13, etc. will only ever have the same problems and you don't escape it even by using Linux clients), or you can pay literally nothing and have a more convenient service that you can stop using any time you like. Your principle is harming absolutely nobody but yourself... Steam aren't missing the money you give GOG.com. You could buy GOG's entire library and barely make a dent in Steam's. And all because you objected to the first versions back when it was still green. You've literally missed out on Half-Life 2, for instance, for no good reason. That, in itself, is a loss greater than anything Steam's ever done in its existence.
- filoeleven 6y agoI expected this to be a (welcomed) repost of a different article about the half-life of code. There was some good discussion in that post, and that article has charts which do a good job of showing a codebase’s evolution. Interesting stuff. https://news.ycombinator.com/item?id=13112449 https://news.ycombinator.com/item?id=13112449