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?

  • @[email protected]
    link
    fedilink
    261 year ago

    Be careful what you wish for. I’ve been part of some rewrites that turned out worse than the original in every way. Not even code quality was improved.

    • @[email protected]
      link
      fedilink
      31 year ago

      In corporations, we call that job security.

      Just rewriting the same thing in different ways for little gain except to say we did it

      • @[email protected]
        link
        fedilink
        4
        edit-2
        1 year ago

        Funnily enough the current one is actually the one where we’ve made the biggest delta and it’s been worthwhile in every way. When I joined the oldest part of the platform was 90s .net and MSSQL. This summer we’re turning the last bits off.

  • @[email protected]
    link
    fedilink
    101 year ago

    I dont know if this even makes sense but damn if bluetooth/ audio could get to a point of “It just works”.

    • @[email protected]
      link
      fedilink
      English
      51 year 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.

      • @[email protected]
        link
        fedilink
        51 year 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.

        • Possibly linux
          link
          fedilink
          English
          21 year ago

          Reinstalling should change nothing. If its getting corrupted check your drive and Ram.

          • @[email protected]
            link
            fedilink
            21 year ago

            I don’t know why this works, but if im having issues, i do this, and it fixes all of them across the board. Even just restarting the service is not as effective as this. That some times works, sometimes doesn’t.

            I’m confident its not a drive or ram issue. Its a blue tooth issue/ audio. But I also can’t explain why it is so consistent.

              • @[email protected]
                link
                fedilink
                11 year ago

                Yep. Nothing sus. I also don’t have the time to do a deep dive. I need to work. It might be this chip. It might be my bluetooth headset (but I have issues with my mouse and keyboard too). I don’t have time to figure it out, so I just keep this on a copy paste ready terminal and if I have issue, I run the command and I’m good to go.

      • @[email protected]
        link
        fedilink
        English
        51 year ago

        It’s been a while (few years actually) since I even tried, but bluetooth headsets just won’t play nicely. You either get the audio quality from a bottom of the barrel or somewhat decent quality without microphone. And the different protocol/whatever isn’t selected automatically, headset randomly disconnects and nothing really works like it does with my cellphone/windows-machines.

        YMMV, but that’s been my experience with my headsets. I’ve understood that there’s some propietary stuff going on with audio codecs, but it’s just so frustrating.

      • Possibly linux
        link
        fedilink
        English
        51 year ago

        Not to mention bluez aggressive conne ts to devices. It would be nice if my laptop in the other room didn’t interrupt my phones connection to my earbuds.

        Then again, we also have wired for a reason. Hate all you want but it works and is predicable

      • @[email protected]
        link
        fedilink
        11 year ago

        My most recent issue with Bluez is that it’s been very inconsistent about letting me disable auto-switching to HSP/HFP (headset mode) when joining any sort of call.

        It’s working now, but it feels like every few months I need to try a different solution.

        • Possibly linux
          link
          fedilink
          English
          1
          edit-2
          1 year ago

          We have clearly had different experiences. If you are a developer maybe troubleshoot and file an issue.

    • @[email protected]
      link
      fedilink
      21 year 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.

    • KryptonBlur
      link
      fedilink
      English
      81 year ago

      What are the advantages of Zig? I’ve seen lots of people talking about it, but I’m not sure I understand what it supposedly does better.

      • @[email protected]
        link
        fedilink
        61 year ago

        The goal of the zig language is to allow people to write optimal software in a simple and explicit language.

        It’s advantage over c is that they improved some features to make things easier to read and write. For example, arrays have a length and don’t decay to pointers, defer, no preprocessor macros, no makefile, first class testing support, first class error handling, type inference, large standard library. I have found zig far easier to learn than c, (dispite the fact that zig is still evolving and there are less learning resources than c)

        It’s advantage over rust is that it’s simpler. Ive never played around with rust, but people have said that the language is more complex than zig. Here’s an article the zig people wrote about this: https://ziglang.org/learn/why_zig_rust_d_cpp/

  • @[email protected]
    link
    fedilink
    English
    111 year ago

    Not too relevant for desktop users but NFS.

    No way people are actually setting it up with Kerberos Auth

    • DefederateLemmyMl
      link
      fedilink
      English
      71 year ago

      100% this

      We need a networked file system with real authentication and network encryption that’s trivial to set up and that is performant and that preserves unix-ness of the filesystem, meaning nothing weird like smb, so you can just use it as you would a local filesystem.

      The OpenSSH of network filesystems basically.

  • Onno (VK6FLAB)
    link
    fedilink
    71 year ago

    In reality this happens all the time. When you develop a codebase it’s based on your understanding of the problem. Over time you gain new insights into the environment in which that problem exists and you reach a point where you are bending over backwards to implement a fix when you decide to start again.

    It’s tricky because if you start too early with the rewrite, you don’t have a full understanding, start too late and you don’t have enough arms and legs to satisfy the customers who are wanting bugs fixed in the current system while you are building the next one.

    … or you hire a new person who knows everything and wants to rewrite it all in BASIC, or some other random language …

  • @[email protected]
    link
    fedilink
    English
    61 year ago

    I’m tempted to say systemd-ecosystem. Sure, it has it’s advantages and it’s the standard way of doing things now, but I still don’t like it. Journalctl is a sad and poor replacement from standard log files, it has a ton of different stuff which used to be their separate own little things (resolved, journald, crontab…) making it pretty monolithic thing and at least for me it fixed a problem which wasn’t there.

    Snapcraft (and flatpack to some extent) also attempts to fix a non-existing problem and at least for me they have caused more issues than any benefits.

  • @[email protected]M
    link
    fedilink
    English
    81 year ago

    Are there any things in Linux that need to be started over from scratch?

    Yes, Linux itself! (ie the kernel). It would’ve been awesome if Linux were a microkernel, there’s so many advantages to it like security, modularity and resilience.

  • @[email protected]
    link
    fedilink
    211 year ago

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

    • @[email protected]
      link
      fedilink
      21 year ago

      I realize that’s not exactly what you asked for but Pipewire had been incredibly stable for me. Difference between the absolute nightmare of using BT devices with alsa and super smooth experience in pipewire is night and day.

    • palordrolap
      link
      fedilink
      61 year ago

      One might exist already: lzlib.

      I admit I haven’t done a great deal of research, so maybe there are problems, but I’ve found that lzip tends to do better at compression than xz/lzma and, to paraphrase its manual, it’s designed to be a drop-in replacement for gzip and bzip2. It’s been around since at least 2009 according to the copyright messages.

      That said, xz is going to receive a lot of scrutiny from now on, so maybe it doesn’t need replacing. Likewise, anything else that allows random binary blobs into the source repository is going to have the same sort of scrutiny. Is that data really random? Can it be generated by non-obfuscated plain text source code instead? etc. etc.

      • @[email protected]
        link
        fedilink
        English
        31 year ago

        Personally I quite like zstd, I find it has a pretty decent balance of speed to ratio at each of its levels.

  • @[email protected]
    link
    fedilink
    191 year 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).

      • @[email protected]
        link
        fedilink
        11 year 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,…).

        • @[email protected]
          link
          fedilink
          2
          edit-2
          1 year 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.

          • @[email protected]
            link
            fedilink
            11 year 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.

              • @[email protected]
                link
                fedilink
                11 year 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.

                • @[email protected]
                  link
                  fedilink
                  1
                  edit-2
                  1 year 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.

      • @[email protected]
        link
        fedilink
        English
        31 year 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.

        • @[email protected]
          link
          fedilink
          3
          edit-2
          1 year 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).

        • @[email protected]
          link
          fedilink
          4
          edit-2
          1 year 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.

          • @[email protected]
            link
            fedilink
            21 year 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.

            • @[email protected]
              link
              fedilink
              11 year 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.

      • @[email protected]
        link
        fedilink
        21 year ago

        stderr is useless if the syscall already returns a single integer only because of stupid C conventions.

    • @[email protected]
      link
      fedilink
      91 year ago

      You mean 0 indicating success and any other value indicating some arbitrary meaning? I don’t see any problem with that.

      Passing around extra error handling info for the worst case isn’t free, and the worst case doesn’t happen 99.999% of the time. No reason to spend extra cycles and memory hurting performance just to make debugging easier. That’s what debug/instrumented builds are for.

      • @[email protected]
        link
        fedilink
        31 year ago

        Passing around extra error handling info for the worst case isn’t free, and the worst case doesn’t happen 99.999% of the time.

        The case “I want to know why this error happened” is basically 100% of the time when an error actually happens.

        And the case of “Permission denied” or similar useless nonsense without any details costing me hours of my life in debugging time that wouldn’t be necessary if it just told me permission for who to do what to which object happens quite regularly.

        • @[email protected]
          link
          fedilink
          11 year ago

          “0.001% of the time, I wanna know every time 👉😎👉”

          Yeah, I get that. But are we talking about during development (which is why we’re choosing between C and something else)? In that case, you should be running instrumented builds, or with debug functionality enabled. I agree that most programs just fail and don’t tell you how to go about enabling debug info or anything, and that could be improved.

          For the “Permission Denied” example, I also assume we’re making system calls and having them fail? In that case it seems straight forward: the user you’re running as can’t access the resource you were actively trying to access. But if we’re talking about some random log file just saying “Error: permission denied” and leaving you nothing to go on, that’s on the program dumping the error to produce more useful information.

          In general, you often don’t want to leak more info than just Worked or Didn’t Work for security reasons. Or a mix of security/performance reasons (possible DOS attacks).

          • @[email protected]
            link
            fedilink
            11 year ago

            During development is just about the only time when that doesn’t matter because you have direct access to the source code to figure out which function failed exactly. As a sysadmin I don’t have the luxury of reproducing every issue with a debug build with some debugger running and/or print statements added to figure out where exactly that value originally came from. I really need to know why it failed the first time around.

            • @[email protected]
              link
              fedilink
              21 year ago

              Yeah, so it sounds like your complaint is actually with application not propagating relevant error handling information to where it’s most convenient for you to read it. Linux is not at fault in your example, because as you said, it returns all the information needed to fix the issue to the one who developed the code, and then they just dropped the ball.

              Maybe there’s a flag you can set to dump those kinds of errors to a log? But even then, some apps use the fail case as part of normal operation (try to open a file, if we can’t, do this other thing). You wouldn’t actually want to know about every single failure, just the ones that the application considers fatal.

              As long as you’re running on a turing complete machine, it’s on the app itself to sufficiently document what qualifies as an error and why it happened.

              • @[email protected]
                link
                fedilink
                11 year ago

                The whole point of my complaint is that shitty C conventions produce shitty error messages. If I could rely on the programmer to work around those stupid conventions every time by actually checking the error and then enriching it with all relevant information I would have no complaints.

              • @[email protected]
                link
                fedilink
                11 year ago

                I know about strace, strace still requires me to reproduce the issue and then to look at backtraces if nobody bothered to include any detail in the error.

      • @[email protected]
        link
        fedilink
        English
        61 year ago

        Ugh, I do not miss C…

        Errors and return values are, and should be, different things. Almost every other language figured this out and handles it better than C.

        • @[email protected]
          link
          fedilink
          31 year ago

          Errors and return values are, and should be, different things.

          That’s why errno and return value are different things.

        • @[email protected]
          link
          fedilink
          51 year ago

          It’s more of an ABI thing though, C just doesn’t have error handling.

          And if you do exception handling wrong in most other languages, you hamstring your performance.