I’m curious how software can be created and evolve over time. I’m afraid that at some point, we’ll realize there are issues with the software we’re using that can only be remedied by massive changes or a complete rewrite.

Are there any instances of this happening? Where something is designed with a flaw that doesn’t get realized until much later, necessitating scrapping the whole thing and starting from scratch?

  • biribiri11@lemmy.ml
    link
    fedilink
    arrow-up
    39
    ·
    2 years ago

    The entire thing. It needs to be completely rewritten in rust, complete with unit tests and Miri in CI, and converted to a high performance microkernel. Everything evolves into a crab /s

  • nycki@lemmy.world
    link
    fedilink
    arrow-up
    41
    arrow-down
    2
    ·
    edit-2
    2 years ago

    Starting anything from scratch is a huge risk these days. At best you’ll have something like the python 2 -> 3 rewrite overhaul (leaving scraps of legacy code all over the place), at worst you’ll have something like gnome/kde (where the community schisms rather than adopting a new standard). I would say that most of the time, there are only two ways to get a new standard to reach mass adoption.

    1. Retrofit everything. Extend old APIs where possible. Build your new layer on top of https, or javascript, or ascii, or something else that already has widespread adoption. Make a clear upgrade path for old users, but maintain compatibility for as long as possible.

    2. Buy 99% of the market and declare yourself king (cough cough chromium).

  • smileyhead@discuss.tchncs.de
    link
    fedilink
    arrow-up
    36
    arrow-down
    1
    ·
    2 years ago

    Maybe not exaclly Linux, sorry for that, but it was first thing that get to my mind.
    Web browsers really should be rewritten, be more modular and easier to modify. Web was supposed to be bulletproof and work even if some features are not present, but all websites are now based on assumptions all browsers have 99% of Chromium features implemented and won’t work in any browser written from scratch now.

  • LeFantome@programming.dev
    link
    fedilink
    arrow-up
    30
    ·
    2 years ago

    Linux does this all the time.

    ALSA -> Pulse -> Pipewire

    Xorg -> Wayland

    GNOME 2 -> GNOME 3

    Every window manager, compositor, and DE

    GIMP 2 -> GIMP 3

    SysV init -> SystemD

    OpenSSL -> BoringSSL

    Twenty different kinds of package manager

    Many shifts in popular software

    • loutr@sh.itjust.works
      link
      fedilink
      arrow-up
      8
      arrow-down
      1
      ·
      2 years ago

      BoringSSL is not a drop-in replacement for openssl though:

      BoringSSL is a fork of OpenSSL that is designed to meet Google’s needs.

      Although BoringSSL is an open source project, it is not intended for general use, as OpenSSL is. We don’t recommend that third parties depend upon it. Doing so is likely to be frustrating because there are no guarantees of API or ABI stability.

    • embed_me@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      2 years ago

      Aren’t different kinds of package managers required due to the different stability requirements of a distro?

  • limelight79@lemm.ee
    link
    fedilink
    arrow-up
    28
    ·
    2 years ago

    We haven’t rewritten the firewall code lately, right? checks Oh, it looks like we have. Now it’s nftables.

    I learned ipfirewall, then ipchains, then iptables came along, and I was like, oh hell no, not again. At that point I found software to set up the firewall for me.

    • catloaf@lemm.ee
      link
      fedilink
      English
      arrow-up
      10
      arrow-down
      1
      ·
      2 years ago

      Damn, you’re old. iptables came out in 1998. That’s what I learned in (and I still don’t fully understand it).

  • gnuhaut@lemmy.ml
    link
    fedilink
    arrow-up
    23
    arrow-down
    2
    ·
    2 years ago

    GUI toolkits like Qt and Gtk. I can’t tell you how to do it better, but something is definitely wrong with the standard class hierarchy framework model these things adhere to. Someday someone will figure out a better way to write GUIs (or maybe that already exists and I’m unaware) and that new approach will take over eventually, and all the GUI toolkits will have to be scrapped or rewritten completely.

    • Lung@lemmy.world
      link
      fedilink
      arrow-up
      12
      ·
      2 years ago

      Idk man, I’ve used a lot of UI toolkits, and I don’t really see anything wrong with GTK (though they do basically rewrite it from scratch every few years it seems…)

      The only thing that comes to mind is the React-ish world of UI systems, where model-view-controller patterns are more obvious to use. I.e. a concept of state where the UI automatically re-renders based on the data backing it

      But generally, GTK is a joy, and imo the world of HTML has long been trying to catch up to it. It’s only kinda recently that we got flexbox, and that was always how GTK layouts were. The tooling, design guidelines, and visual editors have been great for a long time

      • Joe Breuer@lemmy.ml
        link
        fedilink
        arrow-up
        18
        ·
        2 years ago

        Which - in my considered opinion - makes them so much worse.

        Is it because writing native UI on all current systems I’m aware of is still worse than in the times of NeXTStep with Interface Builder, Objective C, and their class libraries?

        And/or is it because it allows (perceived) lower-cost “web developers” to be tasked with “native” client UI?

    • KindaABigDyl@programming.dev
      link
      fedilink
      arrow-up
      5
      ·
      2 years ago

      I’ve really fallen in love with the Iced framework lately. It just clicks.

      A modified version of it is what System76 is using for the new COSMIC DE

  • MrAlternateTape@lemm.ee
    link
    fedilink
    arrow-up
    22
    arrow-down
    1
    ·
    2 years ago

    It’s actually a classic programmer move to start over again. I’ve read the book “Clean Code” and it talks about a little bit.

    Appereantly it would not be the first time that the new start turns into the same mess as the old codebase it’s supposed to replace. While starting over can be tempting, refactoring is in my opinion better.

    If you refactor a lot, you start thinking the same way about the new code you write. So any new code you write will probably be better and you’ll be cleaning up the old code too. If you know you have to clean up the mess anyways, better do it right the first time …

    However it is not hard to imagine that some programming languages simply get too old and the application has to be rewritten in a new language to ensure continuity. So I think that happens sometimes.

  • Hector@lemmy.ca
    link
    fedilink
    arrow-up
    20
    ·
    2 years ago

    Some form of stable, modernized bluetooth stack would be nice. Every other bluetooth update breaks at least one of my devices.

  • Hawke@lemmy.world
    link
    fedilink
    arrow-up
    10
    arrow-down
    1
    ·
    edit-2
    2 years ago

    There are many instances like that. Systemd vs system V init, x vs Wayland, ed vs vim, Tex vs latex vs lyx vs context, OpenOffice vs libreoffice.

    Usually someone identifies a problem or a new way of doing things… then a lot of people adapt and some people don’t. Sometimes the new improvement is worse, sometimes it inspires a revival of the old system for the better…

    It’s almost never catastrophic for anyone involved.

  • mlg@lemmy.world
    link
    fedilink
    English
    arrow-up
    9
    ·
    2 years ago

    Not too relevant for desktop users but NFS.

    No way people are actually setting it up with Kerberos Auth

  • taladar@sh.itjust.works
    link
    fedilink
    arrow-up
    11
    arrow-down
    3
    ·
    2 years ago

    I would say the whole set of C based assumptions underlying most modern software, specifically errors being just an integer constant that is translated into a text so it has no details about the operation tried (who tried to do what to which object and why did that fail).

    • smileyhead@discuss.tchncs.de
      link
      fedilink
      arrow-up
      5
      arrow-down
      1
      ·
      2 years ago

      You have stderr to throw errors into. And the constants are just error codes, like HTTP error codes. Without it how computer would know if the program executed correctly.

      • atzanteol@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        2
        arrow-down
        3
        ·
        2 years ago

        You throw an exception like a gentleman. But C doesn’t support them. So you need to abuse the return type to also indicate “success” as well as a potential value the caller wanted.

        • 0x0@programming.dev
          link
          fedilink
          arrow-up
          4
          arrow-down
          1
          ·
          2 years ago

          Exceptionss are bad coding, and what’s abusive of using the full range of an integer? 0 success, everything else, error - check the API for details or call strerror.

          • taladar@sh.itjust.works
            link
            fedilink
            arrow-up
            1
            arrow-down
            1
            ·
            2 years ago

            Returning error codes in-band is the reason for a significant percentage of C bugs and security holes when the return value is used without checking. Something like Rust’s Result type that forces you to distinguish the two cases is much better design here. And no, you are not working with a whole language ecosystem of “sufficiently disciplined programmers” so that nobody ever forgets to check a return value.

            Not to mention that errno is just a very broken design in the times of modern thread and event systems, signals, interrupts and all kinds of other ways to produce race conditions and overwrite the errno value before it is checked.

            • uis@lemm.ee
              link
              fedilink
              arrow-up
              1
              ·
              2 years ago

              errno is not shared between threads. Also:

              signal handlers that call functions that may set errno or modify the floating-point environment must save their original values, and restore them before returning.

              There does not add more race conditions because signal handlers execute in one of regular threads. In single-threaded program signals are functions that can be called by OS at any point of execution, but they do not execute at same time with threads.

        • uis@lemm.ee
          link
          fedilink
          arrow-up
          2
          ·
          edit-2
          2 years ago

          So you need to abuse the return type to also indicate “success” as well as a potential value the caller wanted.

          You don’t need to.

          Returnung structs, returning by pointer, signals, error flags, setjmp/longjmp, using cxa for exceptions(lol, now THIS is real abuse).

      • taladar@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        ·
        2 years ago

        It does very much have the concept of objects as in subject, verb, object of operations implemented in assembly.

        As in who (user foo) tried to do what (open/read/write/delete/…) to which object (e.g. which socket, which file, which Linux namespace, which memory mapping,…).

        • uis@lemm.ee
          link
          fedilink
          arrow-up
          1
          arrow-down
          1
          ·
          2 years ago

          implemented in assembly.

          Indeed. Assembly is(can be) used to implement them.

          As in who (user foo) tried to do what (open/read/write/delete/…) to which object (e.g. which socket, which file, which Linux namespace, which memory mapping,…).

          Kernel implements it in software(except memory mappings, it is implemented in MMU). There are no sockets, files and namespaces in ISA.

          • taladar@sh.itjust.works
            link
            fedilink
            arrow-up
            1
            ·
            2 years ago

            You were the one who brought up assembly.

            And stop acting like you don’t know what I am talking about. Syscalls implement operations that are called by someone who has certain permissions and operate on various kinds of objects. Nobody who wants to debug why that call returned “Permission denied” or “File does not exist” without any detail cares that there is hardware several layers of abstraction deeper down that doesn’t know anything about those concepts. Nothing in the hardware forces people to make APIs with bad error reporting.

              • taladar@sh.itjust.works
                link
                fedilink
                arrow-up
                1
                ·
                2 years ago

                Because if a program dies and just prints strerror(errno) it just gives me “Permission denied” without any detail on which operation had permissions denied to do what. So basically I have not enough information to fix the issue or in many cases even to reproduce it.

                • uis@lemm.ee
                  link
                  fedilink
                  arrow-up
                  1
                  arrow-down
                  1
                  ·
                  2 years ago

                  It may just not print anything at all. This is logging issue, not “C based assumption”. I wouldn’t be surprised if you will call “403 Forbidden” a “C based assumtion” too.

                  But since we are talking about local program, competent sysadmin can strace program. It will print arguments and error codes.

    • 5714@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      3
      ·
      2 years ago

      What’s your latest disfavor?

      Mine is the priorisation of devices. If someone turns on the flatshare BT box and I’m listening to Death Metal over my headphones, suddenly everyone except me is listening to Death Metal.

      • TropicalDingdong@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        2 years ago

        Just being… crappy?

        Not connecting automatically. Bad quality. Some glitchy artifacts. It gets horrible The only work around I’ve found is stupid but running apt reinstall --purge bluez gnome-bluetooth and it works fine. So annoying but I have to do this almost every day.

    • 0x0@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      2 years ago

      Bluetooth in general is just a mess and it’s sad that there’s no cross-platform sdk written in C for using it.