News for hackers. Stuff that matters.
Re:Developer accidentally deletes 3 months of work with Visu... by sangupta on Friday August 18, 2017 @12:10PM (#15047430)
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 Visu... by pllbnk on Friday August 18, 2017 @02:01PM (#15048376)
> 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.

Re:Developer accidentally deletes 3 months of work with Visu... by KayL on Friday August 18, 2017 @12:46PM (#15047736)
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 Visu... by sangupta on Friday August 18, 2017 @01:34PM (#15048140)
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.