9 ms·
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 trie
by theknarf 9y ago
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 like Git obviously isn't going to do. So this is a mismatch between a beginner software developer on windows never having used Git before, and the mental model of Linux tools like Git.
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.
- sashagim 9y agoYou'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.
- yoz-y 9y agoI 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).
- nailer 9y agoThere's a bug out for not deleting files that haven't been added to the repository when discarding changes: https://archive.is/GisMJ https://archive.is/GisMJ
- ehnto 9y agoCertainly 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.
- majewsky 9y ago> 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.
- Boothroid 9y agoYep. Also a quick search of his name reveals a bunch of Quora responses some of which are a bit disturbing. That's not terribly professional either.
- ehnto 9y agoI 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.
- majewsky 9y agoIt'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).
- Boothroid 9y agoCome on though - there are so many ways you can lose data. Having 3 months of work not backed up in any way is foolhardy in the extreme. Hard disk failure, power surge, robbery, data corruption, coffee, fire/flood.. Personally I err on the side of paranoia with these things.
- scarface74 9y agoIf he has that large of a codebase, he may be a VS Code newbie and/or a git newbie but he isn't s computer newbie. Anyone who has anything important on a computer should know to back it up somewhere.
- Cozumel 9y ago>You're blaming the victim. 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.
- Xoros 9y agoI was surprised when the exact same thing happened the first time I "played" with Code :D ! Discovering this the hard way. 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.
- godot 9y agoI 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.
- nextweek2 9y agoThe victim failed the first rule of using a computer, backup your work. 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.
- mercer 9y agoOne of the earliest lessons I learned using a computer is that you don't toss around with options unless you have backups and/or already use form of (distributed!) version control. 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).
- emerongi 9y agoThe 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.
- mrighele 9y agoI 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.
- Boothroid 9y agoThis is it. I find myself making backups of my source controlled folder just in case something I do with SVN messes things up. The absurdity of this is not lost on me.
- sangupta 9y agoThe 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.
- KayL 9y agoMany IDEs delete files permanently, not just VSCode. VSCode has second confirm and warning you: "This is IRREVERSIBLE!"
- sangupta 9y agoI 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.
- pllbnk 9y ago> 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.
- TheAceOfHearts 9y agoThis is one of the reasons I'm happy to have Time Machine on macOS. I've had times where I accidentally removed files due to a careless rm -rf in the terminal, as well as lost file changes due to mistakes with git. If you have local backups enabled, it's easy to recover reasonably recent files and changes. Admittedly, it hasn't happened to me in a fairly long time... But knowing you have some kind of safety net is reassuring. 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.