Live data from Hacker News

Developer accidentally deletes 3 months of work with Visual Studio Code

cc.bingj.com

21–30 of 75 posts

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

#22

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 problem with warning messages is that people will often still just click through them. Someone WILL 100% still click through it and then complain. This is the problem with power tools. They can be very convenient and useful to users who know what they're doing, but harmful to users who are just clicking buttons.

Then you have the option of just saying "you're an idiot" or developing a safety net around the feature so the action can be undone.

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

#23

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 question is more likely: should an operation like this be possible at all? VSCode already gives you a big warning (as shown in the issue) that "discarding changes" is irreversible but it does not explain what "discarding changes" means.

When people empty their recycle bin they kind of understand what is going to happen. Discarding changes speaks to me but evidently not to this person. Personally I tend to put my code in Dropbox in early stages as git commits do not make much sense (of course one can squash everything and do a rebase but that is advanced git already).

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

#24
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.

+1 Graphical tools may help when presenting changes in a repo, but when it comes to making changes I too prefer the CLI.

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

#25

Haha, SourceTree can also do that! Fun times! Source control responsibly people! :)

Windows explorer too, just shift+delete the stuff. Microsoft should probably just make a snapshot-capable filesystem and do complete snapshots every hour or so.

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

#26

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…

I think that the first lesson that he should learn is the need for regular backups.

In fact, I am not even sure he meant to use git ("I hadn't commited any of them to any repository"). If it that's the case, I would understand why he did such a mistake:

* Open the folder in VS Code

* Explore around, discover the Git tab on the left, "This workspace isn't yet under git source control", press the button

* "Whops, I didn't want to do this", check around and see that there is a button to "clean the changes"

* Destroy 5000 files by mistake.

In any case, I don't understand why developer oriented tools rarely take into account the fact that developers too make mistakes, and they should have the ability to undo them. This is especially true with Git, where the UI is in my opinion particularly convoluted and error prone.

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

#27

I predict one day we will look back and be horrified that there was ever a time where you can't just roll back an entire system to an arbitrary timestamp to undo accidental changes. In some sense this is already achievable if you just always work inside a Dropbox folder (which keeps a 30 day history of any synced changes). But resources aren't yet cheap enough for all changes to be immutable.

I don't use it, but isn't that what Time Machine on MacOS does?

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

#28
post #27

I predict one day we will look back and be horrified that there was ever a time where you can't just roll back an entire system to an arbitrary timestamp to undo accidental changes. In some sense this is already achievable if you just always work inside a Dropbox folder (which keeps a 30 day history of any synced changes). But resources aren't yet cheap enough for all changes to be immutable.

I don't use it, but isn't that what Time Machine on MacOS does?

It has been trivially easy to restore files and folders in situations like this with TimeMachine for a very long time.

Thinking of what it would be like to go back to a world without similar functionality makes me shudder.

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

#29
post #23

Earlier quoted context omitted.

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 question is more likely: should an operation like this be possible at all? VSCode already gives you a big warning (as shown in the issue) that "discarding changes" is irreversible but it does not explain what "discarding changes" means. When people empty their recycle bin they kind of understand what is going to happen. Discarding changes speaks to me but evidently not to this person. Personally I tend to…

There's a bug out for not deleting files that haven't been added to the repository when discarding changes:

https://archive.is/GisMJ

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

#30

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.

Certainly there might be room for improvement. But the warning was pretty clear I feel.

At some point you have to take responsibility for knowing your tools. This is a professional.

Post reply on HN