Live data from Hacker News

Developer accidentally deletes 3 months of work with Visual Studio Code

cc.bingj.com

51–60 of 75 posts

Re: Developer accidentally deletes 3 months of work with Visual Studio Code

#51
post #44

Earlier quoted context omitted.

> This is a professional. He might know how to write code, but obliviousness towards source control (and backups, for that matter) is a HUGE indicator of him not being a professional.

I would agree. User friendliness isn't a bad goal for any piece of software, but there is a certain level of knowledge we can expect from a professional. Knowledge of their chosen tooling is one of them I feel.

It's not even knowledge of tooling, it's knowledge of practices. How would you feel about an electrician who doesn't properly ground the circuit he's about to work on? That's how I feel about a programmer who doesn't take backups of his code in short intervals (which is a big part of what VCSs do).

Re: Developer accidentally deletes 3 months of work with Visual Studio Code

#52
post #9

I never trust anything but the commandline when it comes to git. Then I know full and well what I'm doing regardless of the editor. When there are too many icons and buttons to click I don't like to have to remember what they all mean, or how well they map to the underlying core git concepts.

The commandline offers just as much opportunity to screw up your repository as a GUI does, if not more.

Re: Developer accidentally deletes 3 months of work with Visual Studio Code

#53

The sad part is that he didn't learn his lesson. The problem obviously isn't with Visual Studio Code, but with Git (or whatever version control software he tried out). It seems that he didn't know anything about using git and accidentally checked out a bare repo instead of adding his files to stage. From his post, he says he's using windows and he's used to things going into the recycle bin, something a Linux tool li…

You're blaming the victim. Yes, it's better to know git than not knowing it, but the developer was merely tossing around with the various options of the IDE. It shouldn't be that easy to make an operation with such disastrous results. It is the responsibility of the product designers to prevent this.

I think the obvious thing that VSCode could've done to avoid this disaster was moving files to recycle bin instead of deleting permanently on discard. You or OP might say why would the behavior of a Linux tool like git move to recycle bin? Well, TortoiseGit on Windows (git client) (or even going as far back as TortoiseSvn) will always move files to recycle bin when you discard changes. If they can, there's very little excuse why VSCode can't. There is also very little maintenance overhead for a user. Once in a while you notice your recycle bin isn't empty and you go and empty it.

Re: Developer accidentally deletes 3 months of work with Visual Studio Code

#54
Well, that's not very positive... but I can relate. VS Code lost some work of mine on the first day I tried it, so I decided not to continue using it. It wasn't super important so I wasn't angry, but it was a good chunk of code I had just spent probably 45 minutes writing and debugging.

You could argue it was my fault because I didn't stage and commit the new file, but there's no reason to close a buffer just because the backing file is gone. Close it if I say so, otherwise keep it open with the last-seen contents of the file. This has always worked fine in Sublime.

Please always err on the side of not losing data, even if it means keeping around "annoying" extra tabs.

Re: Developer accidentally deletes 3 months of work with Visual Studio Code

#55

The sad part is that he didn't learn his lesson. The problem obviously isn't with Visual Studio Code, but with Git (or whatever version control software he tried out). It seems that he didn't know anything about using git and accidentally checked out a bare repo instead of adding his files to stage. From his post, he says he's using windows and he's used to things going into the recycle bin, something a Linux tool li…

The victim is not at fault.

1. On Windows, the standard mechanism to delete files it to move/ to 'Recycle Bin' - why did the IDE override the functionality?

2. In git, this action is equivalent to 'git checkout' that will show you a message to stash. In earlier versions of git, where message to git stash are not shown, the files are not deleted from disk.

The problem highlighted here is a genuine one, the IDE MUST and MUST show warning before such destructive operations.

Re: Developer accidentally deletes 3 months of work with Visual Studio Code

#56

The sad part is that he didn't learn his lesson. The problem obviously isn't with Visual Studio Code, but with Git (or whatever version control software he tried out). It seems that he didn't know anything about using git and accidentally checked out a bare repo instead of adding his files to stage. From his post, he says he's using windows and he's used to things going into the recycle bin, something a Linux tool li…

The victim is not at fault. 1. On Windows, the standard mechanism to delete files it to move/ to 'Recycle Bin' - why did the IDE override the functionality? 2. In git, this action is equivalent to 'git checkout' that will show you a message to stash. In earlier versions of git, where message to git stash are not shown, the files are not deleted from disk. The problem highlighted here is a genuine one, the IDE MUST an…

Many IDEs delete files permanently, not just VSCode.

VSCode has second confirm and warning you: "This is IRREVERSIBLE!"

Re: Developer accidentally deletes 3 months of work with Visual Studio Code

#58
post #56

Earlier quoted context omitted.

The victim is not at fault. 1. On Windows, the standard mechanism to delete files it to move/ to 'Recycle Bin' - why did the IDE override the functionality? 2. In git, this action is equivalent to 'git checkout' that will show you a message to stash. In earlier versions of git, where message to git stash are not shown, the files are not deleted from disk. The problem highlighted here is a genuine one, the IDE MUST an…

Many IDEs delete files permanently, not just VSCode. VSCode has second confirm and warning you: "This is IRREVERSIBLE!"

I 100% agree that the warning is displayed. But can't we not make that a bit more user-centric - to say, "You are going to remove all your files from your disk. This is IRREVERSIBLE."

Would that not be a better info/warning message to a user?

And if many IDEs delete files permanently, why can't VSCode start to do what's the right thing - move it to Trash/Recycle Bin.

Many startups (like Slack) didn't copy what all did, they did the right thing.

Re: Developer accidentally deletes 3 months of work with Visual Studio Code

#59

The sad part is that he didn't learn his lesson. The problem obviously isn't with Visual Studio Code, but with Git (or whatever version control software he tried out). It seems that he didn't know anything about using git and accidentally checked out a bare repo instead of adding his files to stage. From his post, he says he's using windows and he's used to things going into the recycle bin, something a Linux tool li…

The victim is not at fault. 1. On Windows, the standard mechanism to delete files it to move/ to 'Recycle Bin' - why did the IDE override the functionality? 2. In git, this action is equivalent to 'git checkout' that will show you a message to stash. In earlier versions of git, where message to git stash are not shown, the files are not deleted from disk. The problem highlighted here is a genuine one, the IDE MUST an…

> 1. On Windows, the standard mechanism to delete files it to move/ to 'Recycle Bin'

It is the standard mechanism when you are working with Windows Explorer (explorer.exe). However, if you try doing it via any API, it is far from trivial. All of the standard file delete operations in all platforms that I have worked with delete the files straight away. From developer's point of view, Recycle Bin is just a Windows Explorer's concept and not something that other applications should know how to work with.

Post reply on HN