Though the Windows thing was really funny 😂.

  • bort@sopuli.xyz
    link
    fedilink
    arrow-up
    0
    ·
    6 months ago

    the linux-file-deletion is used as a example for good software design. It has a very simple interface with little room for error while doing exactly what the caller intended.

    In John Ousterhout’s “software design philosophy” a chapter is called “define errors out of existence”. In windows “delete” is defined as “the file is gone from the HDD”. So it must wait for all processes to release that file. In Linux “unlink” is defined as “the file can’t be accessed anymore”. So the file is gone from the filesystem immediately and existing file-handles from other processes will life on.

    The trade-off here is: “more errors for the caller of delete” vs “more errors due to filehandles to dead files”. And as it turns out, the former creates issues for both developers and for users, while the later creates virtually no errors in practice.

    • lemmyvore@feddit.nl
      link
      fedilink
      English
      arrow-up
      0
      ·
      6 months ago

      doing exactly what the caller intended.

      No, no. Exactly what the user told it to do. Not what they intended. There’s a difference.

      • hstde@feddit.de
        link
        fedilink
        arrow-up
        0
        ·
        6 months ago

        Exactly type rm -rf / instead of rm -rf ./ and you ducked up. Well you messed up a long time ago by having privileges to delete everything, but then again, you are human, some mistakes will be made.