7 ms·
Drowning in code: The ever-growing problem of ever-growing codebases
- lproven 3y agoThis is part 1 of my Reg adaptation of my FOSDEM 2024 talk: https://fosdem.org/2024/schedule/event/fosdem-2024-3095-one-way-forward-finding-a-path-to-what-comes-after-unix/ https://fosdem.org/2024/schedule/event/fosdem-2024-3095-one-... I plan to return to the rest. Thanks for sharing it.
- ykonstant 3y agoThank you for the talk, it was very interesting! But, a very pertinent question to everyone: is there some magic ffmpeg incantation or filter to remove mic noise from a video, or otherwise improve the audio of spoken word? Some of the FOSDEM talks, this one included, are very hard to listen to for someone with sensitive hearing issues.
- lproven 3y agoI've uploaded the script I wrote for it to the FOSDEM site, and it's on my personal blog as well. https://liam-on-linux.dreamwidth.org/90185.html https://liam-on-linux.dreamwidth.org/90185.html I also also shared both the slideshow, and the slideshow annotated with speaker's notes -- basically the script, cut into bits and added to each slide. Either should help. That's about all I can offer; I'm not a video person and I know nothing of sound processing or anything.
- lproven 3y agoAlso, @dang: this is a dupe of: https://news.ycombinator.com/item?id=39346402 https://news.ycombinator.com/item?id=39346402
- samsquire 3y agoThanks for the article. Regarding the article which talks about multicore. Multicore and distributed systems are hard. Behaviour implementation, and transforming event sequences across multicore and multimachine consistently is the hard part of computing for me (distributed systems). And understanding large existing systems such as Chromium, Firefox or GCC. Any enterprise K8s cluster with operators everywhere. That's a lot of code. This is just my thoughts, I find it easier to write code than read large code bases because like trying to understand a very large mathematical formulae in one go. You cannot even get the entire system into a screenful to understand it, like you could potentially a small formulae. I have to break it out into ordered steps to understand mathematics. They're like an object in the mind that you interact with intuitively. My mental model is the key driver to the act of programming. I sometimes get the mental model right and serialise it into code. Writing is an expression of thoughts and there is a thought that gets turned into notation. Do either of them (thought,notation) represent the other losslessly? I once used OpenGrok, a web based sourcecode repository viewer to tell myself I would try reading and understanding a large code base. The semantics of programming languages have an impedance mismatch to how my mental model works.... I have mental models about relational databases and what is fast on a computer. And then there is behaviour, state and IO to work with. I could change my mental model to match the programming language semantics on the computer but I would probably be less happy that way. I feel programming languages such as C++ and Rust and Haskell introduce abstractions that work with a certain mental model of solving problems, but not everyone has the same mental model. They work great for the compiler codegen writer, but not for implementing behaviours. If you've ever worked in a enterprise Java codebase or a frontend software React codebase, from my perspective they're a mess because of the imposed semantics of the language and false problems of trying to get the computer to have the right sequence of actions or behaviour sequence.
- kjkjadksj 3y agoTrying to figure out someone elses code is usually like being told to go into a strangers house and find where the hammer is. And your boss expects you to know where exactly it is as if there’s any standard to how different people organize their lives or thoughts.
- jasfi 3y agoThe problem is managing complexity. The way we typically do this is to summarize things so that we can get a good idea of the whole, while focusing on the points we need to at the time. I believe that dynamic documentation is the way forward when it comes to this. Auto Wiki by Mutable AI looks very promising. https://wiki.mutable.ai/ https://wiki.mutable.ai/ https://news.ycombinator.com/item?id=38915999 https://news.ycombinator.com/item?id=38915999
- SushiHippie 3y ago> If you’re okay waiting a bit, and we’ll generate it for free. Does this mean it will generate one now automatically, and I can check back after some time, or will I need to contact them for this?
- jasfi 3y agoI'm not affiliated with them, you'd have to ask them.
- clbrmbr 3y agoOberon sounds interesting. How refreshing it could be to have a simple computer system. Even my little IoT project has grown over the years to a rather ungainly proportion, requiring 20min in CI to build many targets. Matter is really the last straw… so bloated!
- lproven 3y ago[Article author here] It is! A potted summary: https://ignorethecode.net/blog/2009/04/22/oberon/ https://ignorethecode.net/blog/2009/04/22/oberon/ A wonderful academic look, short and readable: "Oberon -- the overlooked jewel" https://people.cis.ksu.edu/~danielwang/Investigation/System_Security/download.pdf https://people.cis.ksu.edu/~danielwang/Investigation/System_... (PDF, over HTTP, safe)
- vitiral 3y agoIt's not just software, it's all technology. Here's a question: how big would a factory (building) need to be to build everything needed for a "personal computer" AND build everything inside the factory? I'm trying to answer this at https://civboot.org https://civboot.org We need to try to simplicity and document the technology our civilization depends on or it will get away from us.
- fellerts 3y agoSaying that's a monumental task would be the understatement of the week. You're compiling Hari Seldon's Encyclopedia Galactica! Would be interested to check out your site, but https://civboot.org https://civboot.org seems to be down.
- artemetra 3y agohttp://civboot.org http://civboot.org (http) works, and is a redirect to https://github.com/civboot/civboot https://github.com/civboot/civboot .
- vitiral 3y agoI'm trying. It's good to have goals in life. Also, I think it's more possible than you think it is (although clearly not achievable by one person).
- ChrisMarshallNY 3y agoLarge codebases are inevitable. Infrastructure stands on infrastructure. We stand on the shoulders of giants (or at least geeks with good posture). One of the things that folks don't like to think about, is that people, these days, aren't really any smarter than they were, five thousand years ago (in fact, Jared Diamond posited that we're actually a bit stupider). We just have a baseline social infrastructure that allows our "starting point" to be that much more advanced. We are the equivalent of privileged offspring, inheriting family wealth. If we are trained to manage and utilize that wealth, it grows. If we aren't, it will likely get squandered. I started off, writing my own operating systems in assembly. I even have the manual, for my very first engineering project, in 1987 (including the OS code)[0]. It worked, but it was very primitive. I can't imagine writing an OS in assembler, these days. I'm glad someone else did, in C (or whatever). So my "starting point," these days, is having a high-quality, parallel operating system, with a developer SDK (again, someone else that knows what they are doing, did the hard work for me), a compiler and linker (thanks, Chris Lattner, et al), etc. For my own projects, I use a lot of dependencies. The difference is, is that I write most of my own dependencies. These are standalone modules, with each one having its own project lifecycle, documentation, testing, etc. Even if no one else will use them, I still publish them on GitHub, as supported open-source projects, because that means that I don't need to worry about them, when I use them in my own aggregate projects. Basically, "divide and conquer." Big things are composed of small things. It's important for me to do a good job on the small things, so the big things turn out better. But that's just me, and the way I work. YMMV. [0] https://littlegreenviper.com/wp-content/uploads/2022/07/TF30194-Manual-1987.pdf https://littlegreenviper.com/wp-content/uploads/2022/07/TF30... (Downloads a PDF)
- CyberDildonics 3y agoBasically, "divide and conquer." Big things are composed of small things. I don't think this is the controversial part or the difficult conclusion, the challenge is how exactly to do that.
- ChrisMarshallNY 3y agoWhich is what I mentioned. I think the “controversial” part, is probably the care taken, in developing the small things. The dependencies on which I rely (operating systems, compilers, SDKs, etc.) are all very well-designed, solid, and supported. I’m not a huge fan of surfing the bleeding edge. I like to use mature tools (usually. I’ve been writing Swift, since the day it was announced). Like I said, I spend a great deal of time, on each of my modules. Often, the testing code far outweighs the product code. Documentation is also a big deal. I write code and documentation for an audience of one (Yours Truly), but I publish it for everyone. It’s not my concern, whether or not the projects get any GitHub stars. In fact, I prefer it, if they don’t. Here’s an example. I’m currently writing an SDK to provide cleaned data for ML, so I can play around with ML, but it will be quite some time, before I get to that point. I’m still working on making the SDK rock-solid. I have spent the last couple of days, just working on the parser. I still need to write the query/importer. Yesterday, was all about unit tests for the parser. The next part, will require a test harness[0] (a SwiftUI app). Unit tests won’t be useful for that. It will also be my platform for the ML application. Also, code coverage for the parser tests is only about 85%. I plan to use the test harness to test the remaining 15%. Many folks would simply rush through this part, but they would end up shipping (or throwing out) the sloppy code they wrote as a lash-up. Even if I decide that I don’t have a current application for ML, I’ll still have a top-Quality SDK, to use as a component for future work. The app I just released, has a backend server, that I originally designed as a general-purpose application server. It took me seven months to write, as it was written in layers, and each layer was rigorously tested, before moving to the next. The purpose of that project, was as a teaching exercise. I didn’t actually have an application in mind, when I wrote it. The server is a lot more complex than it needs to be, because it was designed as a general-purpose server, and the current implementation uses a fraction of its capacity. But the server was available, when I started work on the app, and I already knew it was extremely high-Quality, so using it wasn’t a big deal. It probably saved me a couple of months, and I really have a difficult time, trusting backend dependencies. [0] https://littlegreenviper.com/miscellany/testing-harness-vs-unit/ https://littlegreenviper.com/miscellany/testing-harness-vs-u...
- agentultra 3y agoIsn’t part of the bloat that the instruction sets of these platforms are also bloated? The Intel manual is quite large. Are we close to compiling towards the optimal code for Intel chips? If we could achieve that then we’d at least be in lock step with the hardware… But syntactically and semantically we’re kind of stuck in the stone ages. We’ve had languages that can compress a ton of information into a single combinator for some time but the dominant mode of thinking in industry is procedural. I wonder if Eliot is right and the way forward at a certain scale is through correct software: designed and compiled from dependently typed languages with the aid of theorem provers.
- Cthulhu_ 3y agoI don't believe that's the problem, and in any case, 99% of software developers never have to worry about the underlying instruction set. That said, ARM is already a reduced instruction set, so if someone happens to work in that area, focusing on ARM is an option.
- javier_e06 3y agoThe article intersects very well with AI tools poised to analyze the code and try to understand it for us. Software tools already exist to deal with large code bases, for example, right now, we use software tools (valgrind, coverity) to help us understand the code. Lead architects use analysis tools as well as developers eyeballs to vet the code. Soon enough an AI tool will guide developers on understanding their own codebase and manage it. The same goes along with infrastructure, ChatGPT can guide you right now with examples on how to create a AWS service from scratch. So yes, the codebase is growing fast and with it the tools to manage it.
- jerf 3y agoAI tools will make the problem immensely worse, not better. No, this is not merely anti-AI sentiment or a complaint about how the AIs of today aren't really as good as they are being presented. For the purposes of this argument I'm assuming AIs will work exactly as advertised some point in the relatively near future and you really can just AI-prompt your way through a non-trivial problem. The reason why we have way too much code isn't that code is too hard, it is that it is too easy. Modern cars are complicated, but their complication is restricted by the limitations of being in three-dimensional space, being something that has to be physically manufactured where each individual part is itself something that a person may have spent a person-month or three on, the failure rates of physical parts and how those rates multiply if you keep piling on the complexity, and so on and so forth. The result is that a car has tens of thousands of parts, but it can't have trillions of parts. It doesn't matter how many engineers you throw at the problem, nothing like a modern car could be that complicated. It would simply be guaranteed that too many parts would fail. (To be that complicated it would have to be a different kind of thing, like some sort of biological organism, which are themselves rather complicated. But we humans don't make those.) We have monstrous code bases because they are easy to add to. We can add a new module and test that module in a degree of isolation no physical engineer could dream of. We have analysis tools with no physical equivalent. We don't even design the raw parts, which would be the compiled assembly, we have piles and piles of tools to take things much simpler to understand ("source code") and turn them into the final parts rather than working with the final parts directly. It is easy to be cynical about things like browser quality and I see a lot of fashionable poses struck about this on HN, but the reality is there is nothing like Chrome in the physical world. It is the software world whose artifacts are approaching biological levels of complexity. This isn't because we software engineers are special as people. Engineering tasks by their nature tend to rise to the maximum level of complexity the engineers can deal with, and we all have basically the same intellectual prowess. But we software engineers have unparalleled tools to deal with our complexity, so we get orders of magnitude farther down the path of creating it, and then having to deal with it. Thus, when you understand that our code bases are complex because creating more code is easy, not because it is hard, you can then easily see that any paradigm shift that makes it even easier to create code means that we will have even more of it, not less. If I can type "Dear GPT-12, I don't like my web browser. Please write a standards-compliant web browser except the tabs stack in 3D in my VR environment instead.", and a few hours later the world actually has another 150 millions lines of code and a new browser (I'm assuming more standards the browser will have to implement in the meantime) to deal with, that's not going to contribute to simplifying the code world. It will not be a situation where you "can" use AI tools. It will become a situation where you will have no ability to do anything else, and the code will naturally grow to the limits of what AI can deal with, until it then exceeds even those tools as much as our current code bases are exceeding ours. Of course, then the question is, what will we get for that complexity? I don't know. But you'd better hope it doesn't break because your only option to fix it will basically be "Oh AI genie, please fix this code." And I do think I can guarantee a lot of quirkiness in the result, where things just randomly don't work and it becomes even beyond the AI's abilities to understand why.
- knallfrosch 3y ago> There is an urgent need for smaller, simpler software. No. There is not. The evidence proves the opposite. Users have problems and they pay good money to have them solved. They care not one bit how you achieve that. They neither care nor see that you installed 10,000 npm modules to make the text in your app also work for right-to-left arabic users. They don't care whether your app is 50MB or 150MB. You ship Electron and they see that their beloved app works on their iPad exactly as on the web browser your work PC has installed. In any case, most of the assumptions in the article are wrong anyway. > they can struggle to recognize our faces Hundreds of millions of iPhones are unlocked dozens of times per day, probably with face recognition.
- nehal3m 3y ago> They neither care nor see that you installed 10,000 npm modules to make the text in your app also work for right-to-left arabic users. They do care about being hacked, short load times and some guarantee of support in the future. > They don't care whether your app is 50MB or 150MB. Sysadmins, people with poor connections and people with cheap hardware do. > You ship Electron and they see that their beloved app works on their iPad exactly as on the web browser your work PC has installed. As in slow as balls. Sorry, that last one was a layup.
- Alifatisk 3y ago> They do care about being hacked, short load times and some guarantee of support in the future. Yeah, I do care about my integrity and support in the future (as a customer) but that’s not my responsibility, it’s yours as developer.
- knallfrosch 3y agoYeah, we all care about good, fast software. But I don't think we (as in users) "need" small and fast software. Reality is often disappointing, but I don't see people choosing one music streaming service over the other because their desktop client is written in a more concise programming language.
- lproven 3y ago
- sinuhe69 3y agoThat's exactly why we need to modularize and componentize. We need to reduce dependency, loose the coupling and eliminate side effects. Monolithic is a dead end. Microservices when things get too complex.
- ddejohn 3y ago> Microservices when things get too complex. Microservices are a huge step up in complexity. I'm not convinced monoliths can't be implemented well.
- TremendousJudge 3y agohttps://grugbrain.dev/ https://grugbrain.dev/ has the following to say about microservices: "grug wonder why big brain take hardest problem, factoring system correctly, and introduce network call too seem very confusing to grug"
- klysm 3y agoDoesn't modularization and compartmentalization increase dependency? I'm curious on how you propose we do both at the same time.
- Cthulhu_ 3y agoMicroservices to reduce complexity and coupling is a fallacy. https://riak.com/posts/technical/microservices-please-dont/ https://riak.com/posts/technical/microservices-please-dont/ is a great and succinct counter to all the advantages that microservices claim to have. In summary: > You don’t need to introduce a network boundary as an excuse to write better code > Distributed Transactions are never easy > A bunch of engineers working in isolated codebases leads to ‘Not my problem’ syndrome
- kjkjadksj 3y agoOn the other hand, now there are a couple hundred cryptically named processes running at all times. How many services does Adobe need to run on my computer when I am not actually running their programs? Quite a few as it were.
- jandrewrogers 3y agoI think the main reason codebases are ever-growing is that we never ask, in a serious way, the question "could this be much smaller". I can't recall a company where there was ever a concerted effort to consistently refactor a codebase for conciseness, nor where the inevitable breaking changes from that activity would be tolerated. It is difficult to find an economic argument for such activity but it bears a significant resemblance to a "tragedy of the commons" scenario. By contrast, if I look at my large private codebases, which I religiously refactor and modernize every few years if I think I could improve them even on elegance grounds, have shrunk in size and complexity by a significant integer factor over the many years. And this observable shrinkage happened while adding significant features and materially improving scalability, performance, parallelism, and robustness. The difference is that I can break my APIs and architectures anytime I want and the only person who is mildly inconvenienced is me, and I don't have to justify the time spent doing so. If I look at the mechanics of how the shrinkage happens, I invest a lot in building highly refined code tools that replace recurring development patterns seen across codebases, and then deploy them everywhere that pattern occurs. It is a kind of inductive library building, done to high standard. Again, not a pattern I see much in other large codebases. If the code works, we rarely change it, and it is difficult to justify this kind of tool building when we could be shipping features instead. I understand why the incentives in engineering organizations of any size will never encourage working this way, except outside perhaps the occasional small team. There is a strong bias toward maximizing convenience and minimizing transaction costs in the moment, which are felt keenly. Whereas, the significant drag on productivity and maintainability is highly diffuse and only felt over a long time.
- prepend 3y ago> I think the main reason codebases are ever-growing is that we never ask, in a serious way, the question "could this be much smaller" I think we do ask this question, but code bases grow just like cities grow. We have more stuff and do more things and have more people. I think there is a curation and pruning process but still gets bigger over time. Even with serious refactoring, the codebase still grows as the deleted portions are still available in the codebase for reference.
- Pet_Ant 3y ago
- mrguyorama 3y agoI thought the reason was pretty dang simple: Every sprint I get assigned tickets to add new features and code and functionality and edge case handling, and very rarely do I get a sprint where I get a ticket to attempt to remove a minimal dependency. I can't take the time to do that on my own, because then the much vaunted "metrics" will go down.
- Log_out_ 3y agoCode should be booked in books like a assets service costs. The maintenance of your garden is not free even though it's nice 2 have.
- abenga 3y agoI don't understand the singling out of Debian. Debian includes an unbelievable number of software packages, a vanishingly small minority being the core OS.
- lproven 3y ago[Article author here] > I don't understand the singling out of Debian. To counter: I don't understand why it would matter which distro. It is simply because Debian published these statistics. I couldn't find any other distro vendor that did. I used those numbers because I could get those particular numbers. At this scale, it doesn't matter which distro. What do you estimate the scale of the size difference is between general-purpose distros? An order of magnitude? Surely not as much as 2 OoM, and probably less than 1 OoM. Maybe ITRO of 25-50% for most non-enterprise ones.
- abenga 3y agoI think my comment was probably unclear. My problem is the comparison of the reported lines of code between the Debian Project and Oberon OS. The reported lines of code for debian include everything in the repos. The OS, compilers, interpreters, DBMSs, Document managers (Libreoffice, Texlive are probably massive), games, etc. To make it like for like, you would need to compare Debian and Oberon + all the software written for Oberon.
- lproven 3y agoI was simply picking 2 extremes. The real interest here is the midpoint, which is Plan 9. The 9front image is half a gig, and that too includes everything: apps, demos, games, the entire thing. As I said: « “The kernel is 5,119,091 bytes - 5MB or so. “The entire distribution including all sources, documents, local Git repository and binaries is circa 530MB for amd64.” The Plan 9 kernel has 38 system calls. I’ve not been able to find a firm number for Linux, but I have some estimates. As of 2016, kernel 4.7 had about 335. By 2017 that was up to 341. I’ve tried to estimate the number for kernel 6.8 and I think there are 520 across all architectures. » ISTM that you're obsessing over the exact position of one end, whereas in fact, given that we are talking of a difference of roughly 5 orders of magnitude -- five zeroes -- it would make no difference at all if we included every program ever written for every variant of Oberon that ever existed, and the most minimal possible Debian system that can run two shells at once. Debian 12 is on the order of 150,000 lines of code for every single line of A2.