News for hackers. Stuff that matters.
Re:Try Out Rust IDE Support in Visual Studio Code by ericfrederich on Friday August 18, 2017 @03:40PM (#15049126)
Re:Try Out Rust IDE Support in Visual Studio Code by kbenson on Friday August 18, 2017 @03:48PM (#15049187)
LOL. I mean, it sucks to be that guy, but you have to consider that a project editor has the possibility to overwrite your files with gibberish at any time. I would never load some new software that was supposed to manage a project on my project of 5000 files without having a real good backup first. The same way if I was a video editor and was switching to new video editing software, I would make sure to have a good copy of the originals as well as the work up to that point saved so that I could recover any unexpected weirdness of the new software.

None of that helps this guy. I understand that. Maybe Visual Studio Code could have worded it better. This guy played fast and loose with the safety and integrity of his work and he was bit by it. I do feel for him, but more in the way I feel for anyone that does a stupid thing they should have thought more about first, but this is more a problem of him not understanding what he was doing and the category of software he was giving control of all of his files to. If you plugged your weirdly formatted USB drive (but usable by your other systems) into a computer and it said "We can't read this! Should we reformat?" you probably shouldn't click yes if you don't have backups of what was on that USB drive.

Re:Try Out Rust IDE Support in Visual Studio Code by EugeneOZ on Saturday August 19, 2017 @05:20AM (#15052491)
> but you have to consider that a project editor has the possibility to overwrite your files with gibberish at any time

You really need to use other editors if you think so. Removing 15k files without any warning is a pretty lame move from editor developers.

Re:Try Out Rust IDE Support in Visual Studio Code by imtringued on Saturday August 19, 2017 @12:03PM (#15054087)
Re:Try Out Rust IDE Support in Visual Studio Code by Asooka on Sunday August 20, 2017 @05:45AM (#15057700)
This doesn't tell me what changes it's going to discard. The word "uncommitted" should probably be in there somewhere, and I would use "delete" instead of "discard" for a file operation. As in "Delete all uncommitted files and file contents and set them to the last git commit?". Plus a list of changes that will be made, like:

- delete a.txt

- delete b.txt

- delete 123 changed lines from c.txt

As it's worded it's quite vague what's going to be discarded from where and how. Presumably if you know which button you clicked, it's more clear, but if you mis-click and don't know what you clicked, you can quite easily make the same mistake.

Finally, he's right that programs shouldn't be deleting files without a way to recover them in 2017. That operation should require the same level of directed intentionality as launching a nuclear missile.

Re:Try Out Rust IDE Support in Visual Studio Code by outside1234 on Friday August 18, 2017 @05:30PM (#15049880)
This reminds me of when I was 12 years old, learning to program in BASIC, and my probably 15th program was drawing a star on the screen in ASCII.

I named it *.bas, which the interpreter actually ran despite that being a terrible name for anything.

Yeah, I lost all of the other programs in the directory.

Use backups and source control. Sometimes you need to learn things the hard way, but this one, take it from us. :)

Re:Try Out Rust IDE Support in Visual Studio Code by caconym_ on Friday August 18, 2017 @09:06PM (#15050961)
Honestly if you have three months of work not in version control and not backed up and you're willing to click a button labeled "discard" anywhere near your files without taking any precautions then you have only yourself to blame.

Also, I feel bad saying it, but I haven't laughed this hard in a while.

Re:Try Out Rust IDE Support in Visual Studio Code by bennofs on Friday August 18, 2017 @03:45PM (#15049163)
That does sound like a bad UI though. Perhaps vscode could stage the files before, so that they end up in Git's objects at least? Or somehow store them in the reflog
Re:Try Out Rust IDE Support in Visual Studio Code by threatofrain on Friday August 18, 2017 @04:45PM (#15049593)
If I'm reading the situation correctly, Git was also involved in the problem.

This person seemed to have his project under Git version control... but he hadn't committed for 3 months, which implies he viewed Git as an inconvenience at best. Perhaps the company is just passing around some project scaffolding?

Any other GUI over your version control software is going to have the option to discard recent changes. Discarding changes sounds like a potentially damaging thing, so it makes sense that you'd want to gate it with a warning dialogue. But they did gate it, and if files are deleted in the process, they do say DELETED in caps, and then they gate you again with another popup by saying IRREVERSIBLE in caps.

Adding a third popup gate would be excessive.

Re:Try Out Rust IDE Support in Visual Studio Code by DiThi on Friday August 18, 2017 @06:13PM (#15050173)
> but he hadn't committed for 3 months

I get nervous when I haven't commited for 2-3 days. Since I don't want to commit broken code, I make a patch and send it somewhere for peace of mind. In addition to that I have an editor add-on that saves a copy every single time I save a file. One time it allowed me to recover the work of several days.

You don't need backups until you do. Some people learn the hard way.

Re:Try Out Rust IDE Support in Visual Studio Code by TheCoreh on Friday August 18, 2017 @09:32PM (#15051093)
> I get nervous when I haven't commited for 2-3 days.

I get nervous when I haven't commited for 2-3 hours. I can't even begin to comprehend how someone could make 5000+ file changes to a git repo for 2-3 months and not commit once. He probably didn't know about version control, and was working on someone else's project?

Re:Try Out Rust IDE Support in Visual Studio Code by DiThi on Saturday August 19, 2017 @07:59AM (#15052901)
My changes tend to be small, slow but profound. I think a lot on most problems I solve. In other areas of development it would probably be 6-8 hours. I get nervous because the hard disk can break at any moment, but it's unlikely enough that repeating 6-8 hours worth of work every 2-3 years is an acceptable risk to me.
Re:Try Out Rust IDE Support in Visual Studio Code by fermuch on Friday August 18, 2017 @10:57PM (#15051398)
Git stash is a great tool to keep unfinished work, IMO. You _stash_ your changes if you need to work on something else, and then you pop it from the stash to continue working on it. No commits, no branches. Just stash and pop.
Re:Try Out Rust IDE Support in Visual Studio Code by DiThi on Saturday August 19, 2017 @08:01AM (#15052909)
I use stash all the time. That's not the problem. The worry is losing the whole repo because of hard disk failure.
Re:Try Out Rust IDE Support in Visual Studio Code by antaviana on Saturday August 19, 2017 @02:34PM (#15054865)
I use an AWS instance for development (on Windows, I suppose that Linux could also have a similar setup).

This setup allows me to use AWS snapshots to have the disk backed up (crash consistently) once a day (but it could be once an hour or even less). I shut down the AWS instance when I do not use it because it starts up again in seconds when I need it.

When I do not have a fiber connection at hand, I can use my 4G phone as a personal hotspot with 60-80ms latency to AWS Ireland from my country, which gives a great experience with RDP, has been a game changer when in the move.

Since RDP traffic is about only 10MB/hour, even if you work 160 hours a month using the 4G phone you are at 1.6GB/month, which costs about EUR 7/month.

I happen to use various Macs as client machines, but their role is mostly a thin client with occasional web browsing.

This VDI approach allows the Mac specs to be quite low (one of my Macs was bought in 2009). In any case, if I ever need to upgrade because of software becaming heavier, I just need to change the AWS instance type.

Re:Try Out Rust IDE Support in Visual Studio Code by ivuicuviudfiv on Friday August 18, 2017 @07:33PM (#15050556)
> I have an editor add-on that saves a copy every single time I save a file

This sounds very useful! Is this addon for vscode? Please educate me :-)

Re:Try Out Rust IDE Support in Visual Studio Code by DiThi on Saturday August 19, 2017 @08:03AM (#15052924)
It's an atom addon called local-history. It seems there's a VS code addon of the same name with the same functionality.
Re:Try Out Rust IDE Support in Visual Studio Code by laythea on Saturday August 19, 2017 @05:17AM (#15052484)
This sounds very wasteful unless it is doing diffs in the background. In which case, git would be better.
Re:Try Out Rust IDE Support in Visual Studio Code by DiThi on Saturday August 19, 2017 @08:09AM (#15052952)
It doesn't do diffs and it's no replacement for git, but complements it as one added layer of protection. It's kind of wasteful but my local-history is 100 mb big after some months. And you can tell it to auto purge anything older than X days. I would put 90 days as default instead of 30.
Re:Try Out Rust IDE Support in Visual Studio Code by Mad_Mac on Friday August 18, 2017 @03:55PM (#15049241)
It's pretty bad UI design, but pressing the discard button does open a confirmation box that says "Are you sure you want to discard ALL changes? This is IRREVERSIBLE!"

With that kind of a message, it's amazing how he didn't think twice about discarding them. Especially when he didn't have a proper source control before.

Re:Try Out Rust IDE Support in Visual Studio Code by josteink on Friday August 18, 2017 @04:47PM (#15049606)
3 months of code work and no version control...

You have to wonder if he actually learnt a valuable lesson or just ran away blaming Microsoft...

Re:Try Out Rust IDE Support in Visual Studio Code by Vinnl on Saturday August 19, 2017 @05:54AM (#15052576)
I'm not hopeful:

> I don't need to explain why I don't have a private repo with my stuff. It is the software's concern NOT to destroy the integrity of a computer like a damn virus. You come here, see my despair and berate me for something that was not my fault, and has happened to a lot of other people? Fuck you.

Re:Try Out Rust IDE Support in Visual Studio Code by DiThi on Friday August 18, 2017 @06:17PM (#15050193)
While I think he should have learn his lesson before, also I think it should show the list of files it would delete.
Re:Try Out Rust IDE Support in Visual Studio Code by fzukfzjk on Friday August 18, 2017 @04:27PM (#15049462)
He most likely didn't have a proper source control because he didn't even know what it is. For someone like him your proposed warning wouldn't be effective, because according to his belief he didn't change anything yet.