• AnAmericanPotato@programming.dev
    link
    fedilink
    English
    arrow-up
    148
    arrow-down
    6
    ·
    1 month ago

    I feel bad for this kid. That really is a bad warning dialog. Nowhere does it say it’s going to delete files. Anyone who thinks that’s good design needs a break.

    Half the replies are basically “This should be obvious if your past five years of life experience is similar to mine, and if it isn’t then get fucked.” Just adding insult to injury.

    • Omega_Jimes@lemmy.ca
      link
      fedilink
      arrow-up
      71
      arrow-down
      2
      ·
      1 month ago

      I’m not great at English, but “discard all changes” shouldn’t ever mean “Delete”.

      • Michal@programming.dev
        link
        fedilink
        arrow-up
        40
        arrow-down
        9
        ·
        1 month ago

        In the context of version control it does. Discarding a change that creates a file means deleting the file.

        • thebestaquaman@lemmy.world
          link
          fedilink
          arrow-up
          15
          ·
          1 month ago

          If you have set up your staging area for a commit you may want to discard (unstage) changes from the staging area, as opposed to discarding changes in the working directory.

          Of course, the difference between the two is obvious if you’re using git CLI, but I can easily see someone using a GUI (and that maybe isn’t too familiar with git) misunderstanding “discard” as “unstage”.

          Either way, what happened here indicates that all the files were somehow added to the VC, without having been committed first, or something like that, because git will not let you discard a file that is untracked, because that wouldn’t make any sense. The fact that the GUI let this person delete a bunch of files without first committing them to the index is what makes this a terrible design choice, and also what makes the use of the word “discard” misleading.

        • Omega_Jimes@lemmy.ca
          link
          fedilink
          arrow-up
          3
          arrow-down
          1
          ·
          1 month ago

          Ok fair enough, but I’m under the impression these files existed before the source control was implemented.

          I guess it’s all up to how the program handles existing files.

          • FiskFisk33@startrek.website
            link
            fedilink
            arrow-up
            4
            ·
            1 month ago

            I guess the newly created git repository was empty, and all the files that was present in the folder represented “changes”

      • stebo@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        7
        arrow-down
        2
        ·
        1 month ago

        I’m pretty sure vscode shows a confirmation dialog when discarding changes will permanently delete a file. I’ve done that recently with temporary files that were no longer needed.

      • stebo@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        4
        arrow-down
        1
        ·
        1 month ago

        the alternative to deleting is emptying the file contents, which is essentially the same…

    • cocobean@bookwormstory.social
      link
      fedilink
      English
      arrow-up
      42
      ·
      1 month ago

      Also, why not send them to the recycle bin? I never really thought about it before, but that does seem a reasonable UX improvement for this case

    • kehet@sopuli.xyz
      link
      fedilink
      arrow-up
      5
      arrow-down
      1
      ·
      1 month ago

      Came here to say this. No one deserves this, not even new programmers who try to learn things.

      Some programming tools are really powerful compared to what new users are used to. If you come from the world of Microsoft Office and Apple whatever it’s called, everything is saved automatically to cloud and there is some local backup file somewhere which you can just restore. Modern programs are designed to protect users against their own mistakes, and when suddenly that is taken away, it can be a jarring experience.

    • JackbyDev@programming.dev
      link
      fedilink
      English
      arrow-up
      4
      ·
      1 month ago

      It’s so fucking infuriating that so many devs act like this. “This should’ve been obvious!” Fuck off, that’s an unhelpful statement. “You should’ve been using version control! No backup, no sympathy!” Fuck off, they were literally trying to begin using version control for backups.

      Even half the comments on this very Lemmy thread are disparaging this dev. I wonder how many actually read the thread and found that there was a bug discovered causing this feature to delete files not even associated with git?

      But, congratulations to them, I suppose. Congratulations on making fun of someone. I hope it makes them feel powerful. 🙄 Devs can be so toxic.

    • Scary le Poo@beehaw.org
      link
      fedilink
      arrow-up
      1
      arrow-down
      4
      ·
      edit-2
      1 month ago

      If you’re going to use a git tool, you need to know how git works.

      There are 0 excuses for not having months of work in a repo, none. I have no sympathy whatsoever. How the fuck do you spend so many months without backing up your project or stuffing it in a repo?

      No sympathy. Dude is a shit developer and he learned an invaluable lesson.

      • AnAmericanPotato@programming.dev
        link
        fedilink
        English
        arrow-up
        7
        ·
        1 month ago

        My guess is that this is a teenager, and this is probably their first experience with git and version control in general. Just a hunch.

        Anyway, it is reasonable to expect a mainstream GUI app from one of the largest companies in the world to be approachable for people who do not know all the inner workings of the command line tools that are used behind the scenes. And it is reasonable to expect any destructive action to have clear and bold warnings. “Changes will be discarded” is not clear. What changes? From the user’s perspective, the only changes were regarding version control, so “discarding” that should leave them where they started — with their files intact but not in version control.

        Have mercy on the poor noobs. We were all there once.

      • JackbyDev@programming.dev
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 month ago

        If you’re going to use a git tool, you need to know how git works.

        I guarantee you at least half of git users would get glossy eyes as soon as you mention blobs and trees, yet they all still manage to use it daily successfully.

        There are 0 excuses for not having months of work in a repo, none. I have no sympathy whatsoever. How the fuck do you spend so many months without backing up your project or stuffing it in a repo?

        I need you to listen to me very carefully: THEY WERE FUCKING SETTING UP A REPO WHEN THIS HAPPENED.

        • Scary le Poo@beehaw.org
          link
          fedilink
          arrow-up
          1
          arrow-down
          1
          ·
          1 month ago

          No, by his own admission, he was playing around with the IDE. He wasn’t interested in the version control, he was interested in the pretty editor.

          I suggest you go read the original issue.