Hacker News new | ask | show | jobs
by sashagim 3222 days ago
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.
9 comments

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).

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

https://archive.is/GisMJ

I 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.

I 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.
If 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.

One 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).

The 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.

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.

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

I 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.
It'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).
Yep. 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.
Come 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.
>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.