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).
Well not that hard, because of course I tried it first on a copy of the project so haven't lost anything (if not time).
But even if I agree that what is going to happen is unclear for some (included me at the time), and a total wipe of your work is excruciating, you don't "try things" on the only copy of 3 months of work.
Anyone who has anything important on a computer should know to back it up somewhere.
Even most of my relatively computer-illiterate friends and family members do rudimentary backup for their stuff (usually in the form of emailing themselves or just creating a copy).
A three month project without backup or version control shows a lack of basic training.
I wish schools and universities would teach version control on day one of CS courses.
At some point you have to take responsibility for knowing your tools. 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.
The victim did it to themselves, it's like playing with a loaded gun then complaining when you accidentally shoot yourself in the face. A bad workman always blames their tools. At the very least they should have learnt Git.
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.
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.
VSCode has second confirm and warning you: "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.
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.
A lot of our tooling and operating systems were designed for a different time, and their age is really starting to show in cases like these. Fault tolerance is incredibly important, and it has taken a backseat position for far too long.
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.
I agree with him that Visual Studio Code could probably have designed their warning message a bit better, for people like him who have no experience with Git.
And now to the sad part, having accidentally deleted all his files while trying out Git; he will probably never touch Git again! So instead of learning the lesson he should have learned; always use version control on everything, what he did learn was; Git is harmful, don't use it.
Of course it also kinda seems like he blames VS Code and doesn't understand that it was the fault of Git, but that won't make him start using Git anytime soon.
Learning about version control, especially Git, is the most important thing a software developer can learn as early as possible in his career.