Wednesday, May 27, 2015

F12 is downright dangerous.

So, F12.

In Visual Studio, it's the default keyboard shortcut for Go To Definition. Very useful keyboard shortcut. I've used it countless times. I observe other co-workers NOT using it (and simply right clicking and using the menu) and have laughed at the thought. But now I know why they were doing it.

It's right next to the F11 key... what's that? Starting the project, and potentially deploying something you do NOT want to deploy.

Consider this scenario...
You're tired (like I am today)... you press F12 to check a method definition, but you fat finger it. All of a sudden, VS is building.

Building..

You immediately hit Ctrl + Alt+ Break, but guess what? You're viewing the server from RDP, so that just minimizes RDP!

Deploying...

Without any idea of what environment it's targeting (you just came here to check a few methods to analyze a problem!) you freak out. At this point let's say you forgot the menu option to stop a build. There is nothing you can do....

Deployment failed

Thank GOODNESS! An error that the solution already existed. No changes were made. It was targeting DEV in my case so I was okay anyway. But seriously, not going to use F12 anymore. Way too dangerous. Why would they put an innocent "view method definition" command in a key that is right next to a "Build, deploy, and potentially fuck up EVERYTHING" command key? Ey yey yey.

No comments:

Post a Comment