7 ms·
Developer accidentally deletes 3 months of work with Visual Studio Code
- dovdovdov 9y agoHaha, SourceTree can also do that! Fun times! Source control responsibly people! :)
- yoz-y 9y agoWindows explorer too, just shift+delete the stuff. Microsoft should probably just make a snapshot-capable filesystem and do complete snapshots every hour or so.
- Quarrelsome 9y agoits always sad to see people learn the lesson of source control the hard way.
- bigkm 9y agoThis is more of a backup lesson.
- sigjuice 9y agoExactly. Also, source control is not backup. It is possible for bugs in git or mistakes in your workflow to mess up all the copies of your repository.
- devrandomguy 9y agoI would call it a UX design lesson, primarily, although all undesirable changes are also backup lessons.
- NicoJuicy 9y agoSo, his hard drive could die. He could have a virus or a crypto infection. All would delete his work. A developer uses source control, it's as easy as that.
- Vanit 9y agoA developer agrees.
- Boothroid 9y agoQuite apart from the problem of total code loss there's the lack of a safe way to prototype changes - how the hell does he revert in a situation where he inadvertantly breaks his previously working code?! If this guy did any kind of decent IT or programming course you would think they would have covered at least backing up at some point. If he has done a course and still ended up in this situation I'm tempted to say it's time for him to find a new career.
- xeo84 9y agoNo source control, no backups and you "play" with a new software to see how it handles 5000 files? Well... not sure what to say here..
- eklavya 9y agoI have seen people learn to source control the hard way multiple times, but usually they were saved (at least partially) by the local history feature in IDEs. This guy was hit very hard, I feel sorry for him.
- sinxoveretothex 9y agoI know nothing about Visual Studio Code and very little about anything VS in fact, so I have no idea how much is VS's fault and how much is the user's, but seriously, how on Earth is it possible to have 3 months of work not backed up or source controlled in any way? I once had a nasty file system corruption due to disconnecting the power cord that corrupted my (local) git repo and almost made me lose a day of work. Even with source control there are risks. If there is anything positive to take away from this,it should be to learn to consider risk management. If you write code even, say, once every week and haven't yet bothered to learn how to use source control, you owe it to your mental sanity to do it now. EDIT: archived http://web.archive.org/web/20170818080940/http://cc.bingj.com/cache.aspx?d=1462716999241&mkt=de-DE&setlang=en-US&w=xEsMxqoa0KJSwMsTh3p_8w2qryykfDvB http://web.archive.org/web/20170818080940/http://cc.bingj.co...
- gjvc 9y agoI learned about "git checkout ." the hard way once, too. Only lost three hours then, though.
- ogrim 9y agoI 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.
- nallerooth 9y ago+1 Graphical tools may help when presenting changes in a repo, but when it comes to making changes I too prefer the CLI.
- nailer 9y agoI know what you mean, but for all its faults I like Sourcetree here: it doesn't use anything but what git does. You have a staging area, adding, interactive rebasing, everything uses gigs proper terminology. As opposed to the GitHub for Windows app for example which has new words.
- hungerstrike 9y agoThe commandline offers just as much opportunity to screw up your repository as a GUI does, if not more.
- aaronchall 9y agoHere's the description for the man-page for git-clean: > git-clean - Remove untracked files from the working tree https://git-scm.com/docs/git-clean https://git-scm.com/docs/git-clean Now I would call that description very precise and readable. Here's the GUI's warning: > Are you sure you wish to discard ALL changes? This is IRREVERSIBLE! What changes? He didn't change anything. Did the GUI change something? Maybe it did. Maybe nothing will happen. Foolish not to back-up before experimenting? Sure. But GUI's imply friendliness to the inexperienced. This seems like bad UX.
- theknarf 9y agoThe 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).
- tym0 9y agoHe says that it wasn't in a repo, so it's a bit weird that it would delete all his files, it looks more like he had an initialised repo and hadn't committed the files yet. I don't even know how you could work 3 months without committing, even working on a throwaway thing for more than a few hours I make a new local repo, it doesn't cost much. Also the files are not gone, they are still on the hard-drive/SSD it's not that hard to look up file recovery software.
- mjw1007 9y agoThis post shows the likely sequence of actions that makes it happen: https://stackoverflow.com/a/33235641 https://stackoverflow.com/a/33235641 It seems to have happened to rather a lot of people https://social.msdn.microsoft.com/Forums/expression/en-US/b32e47a9-d86c-473a-9449-a7f5c202463c/ https://social.msdn.microsoft.com/Forums/expression/en-US/b3...
- lopespm 9y agoExactly, a good portion of deleted files could probably be salavaged using "Recuva" right away, for example
- Boothroid 9y agoExactly, all the deletion does is remove the file system connection to the location of the data on disk. Someone needs to get in touch with this guy and tell him to stop using that drive!
- arnioxux 9y agoI 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.
- reustle 9y agoI don't use it, but isn't that what Time Machine on MacOS does?
- slindz 9y agoIt 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.
- valpertui 9y agoOn mac os you have system built-in version control on most text based file by default. I recovered lost work with it in a discard once (discarded on the wrong branch and no stash to reapply). https://support.apple.com/kb/PH18862?locale=en_US https://support.apple.com/kb/PH18862?locale=en_US
- mastef 9y agoPro-tip : you can keep your little projects in a Dropbox folder. Will keep track of your file changes automatically and can help restore deleted files / or restore them to earlier versions.
- WeedRamen 9y agoReally feel for the guy. Hasn't happened to me, but I would hope a developer friendly editor would give warnings about when something like this could happen. Does VS Code have a tutorial? Haven't used it before, can't say I am inclined to right now...
- bigkm 9y agoMy response to this person would be: well you're going to have to restore from backup. Oh you don't have a backup? Why not? (Some excuse) LOLZ
- danso 9y agoThe original Github issue seems to have been deleted, but here's a fresher cache that includes a response from a VS Code Microsoft employee, including a pic of what the warning dialog looks like: http://archive.is/EZX1O http://archive.is/EZX1O
- ziotom78 9y agoThanks, that answer actually adds some very important context!
- mercer 9y agoYeah, I actually got this dialog once and immediately clicked on 'cancel' to make sure I understood what the command did. Personally I think this little detail changes the whole situation. And that's not even taking into account the idiocy of not having a backup and not incrementally adding the project to some form of version control. Hell, even for all but the simplest TOY project I create a git repository and push it to gitlab!
- aaronchall 9y agoThis didn't happen to me and I'd like to think I'm being objective here - the dialog says: > Are you sure you wish to discard ALL changes? This is IRREVERSIBLE! Yes, very scary, like many warnings that some systems teach us to ignore. It doesn't say what "changes" will be discarded. Are those the changes it made since the IDE was installed? Did the IDE make changes? Some kind of project files or directories? Some kind of setup? Is a novice supposed to know this? Even on the home-grown IDE I use at work, it saves backups in a trash area when you delete files in case you accidentally delete something you don't intend to. (Actually, I got very concerned once thinking I had deleted something I hadn't committed yet... as I recall it was a false alarm, but I was pleased that my concern was misplaced.) And given that a lot of other people have experienced this, I'd say there is evidence that this is a UX (User eXperience) problem, not necessarily a PEBCAK (Problem Exists Between Chair and Keyboard): https://social.msdn.microsoft.com/Forums/expression/en-US/b32e47a9-d86c-473a-9449-a7f5c202463c/visual-studio-code-just-deleted-all-my-files?forum=visualstudiogeneral https://social.msdn.microsoft.com/Forums/expression/en-US/b3...
- deleted 9y ago[deleted]
- blueprint 9y agoBut, for real, 3 months of work and not a single backup?
- antigirl 9y agoHe deleted his profile, rightly so - thats no way to act on github, open forum for pretty much every web developer out there. Not making a good name for yourself
- Grue3 9y agoThis is a valid complaint. You simply don't design UI that allows to delete a large number of files with a press of a single button. That he didn't have backups is irrelevant. Even accidentally deleting fresh changes is quite damaging. VS Code doesn't say anything about Git, or what Git is. You can't expect anyone who downloads MS software to be a Git expert.
- deleted 9y ago[deleted]
- memer 9y agoBut it wasn't a single button, there was a warning message: https://archive.fo/EZX1O https://archive.fo/EZX1O See joaomoreno's comment on that page.
- stillsut 9y ago"This is Git. It tracks collaborative work on projects through a beautiful distributed graph theory tree model. Cool. How do we use it? No idea. Just memorize these shell commands and type them to sync up. If you get errors, save your work elsewhere, delete the project, and download a fresh copy." - https://xkcd.com/1597/ https://xkcd.com/1597/ I think MS would do well to just buy this comic from Randall Munroe and display it on git init. In 10 seconds you get a more useful and realistic appraisal of the tool than you will from reading the docs for an hour. You heard me right: Docs by Meme.
- whipoodle 9y agoWell, 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.
- devrandomguy 9y agoExcessive automation considered harmful: even if you want something to happen 99% of the time, it should still be a manual operation. Otherwise, it will bite 100 of your 10,000 users at least once.
- whipoodle 9y agoIf it's a destructive operation, yeah. I was really, genuinely surprised that their editor works like that. As you say, it's not something that will bite you often, but when it bites, it could be pretty painful.
- joaomoreno 9y agoActually you can control this behaviour with "workbench.editor.closeOnFileDelete": false
- styfle 9y agoThis got "fixed" in #32459 https://github.com/Microsoft/vscode/issues/32459 https://github.com/Microsoft/vscode/issues/32459
- mcheung610 9y agoThis is like someone is trying to learn how to cook the first time and burned the house down. Instead of blaming himself, he blame the stove and fire.
- nikki-9696 9y agoIt may be victim blaming, but having 3 months of work and it only exists on one hard drive on one computer isn't very bright. He learned the hard way. I mean honestly, disk drives fail. PCs break. The code should never be in only one place regardless. Also, coming from VSS to Git has been, and still is, one of the hardest things I do as a windows dev. I hate git. It is non-intuitive and I have accidentally deleted my work before also, the difference being that I have it stored else where to get it too.
- chrisbennet 9y agoAs a product developer, when a user of my software "makes a mistake" my first response is to ask myself "What could I have done to avoid the user making this mistake?" As Jeff Attwood says: "a well-designed system makes it easy to do the right things and annoying (but not impossible) to do the wrong things." https://blog.codinghorror.com/falling-into-the-pit-of-success/ https://blog.codinghorror.com/falling-into-the-pit-of-succes...
- devrandomguy 9y agoStreisand effect is taking off: https://github.com/Microsoft/vscode/issues/32795 https://github.com/Microsoft/vscode/issues/32795
- lonnie_jones 9y agoHis story is a little funny and a little sad. I had a similar experience but I was much more cautious. I had actually backed up my project through GitHub desktop and committed it before formatting my computer. After cleaning and setting the system back up, I lost a days worth of work. I was 100% sure I had committed it. When I started back where I was and committed my changes, I checked the web Github to ensure that the changes were still submitted and they weren't. There was a bug with Windows 10 and Github that caused it. After that I decided to use Google Drive to backup my Github upon changes. Don't try to use Github folders and Google Drive folders as the same directories. Something weird happens and only one will work. Now I make submissions to Github and have a duplicate folder (using relative paths in my project) in my Google drive. Alternatively, you can submit your changes through the Github website, but it takes forever.