Hmmmmm.....Never bring a gun to a knife fight?
Some interesting comments here that pretty much boil down to a few things -
Action beats reaction - a BG bent on destruction definitely has the advantage - his actions, based on surprise and at least some planning, leaves his intended victim(s) little time to react. Therefore you must use the entirety of your training and surroundings to throw off this advantage - verbal shock - yell as loudly and forcibly as possible to make him hesitate, even a second, before the brunt of the attack begins. Use cover, any cover, to throw off his timing - throw something at him, anything you may be already carrying -a soft drink can, keys, a coat, etc. Move laterally away from the attack, put something between him and you - a garbage can, move around a car, light post, anything to keep him away. Of course this leads to -
Situational awareness - who is near me? what is he up to? where can I run/hide? what can I use to throw at him? Should I be indexing my weapon? Do I stare him down? What are my advantages here and now?
Attitude - I'm going to WIN this looming battle - NO MATTER WHAT!!! I have been trained and educated on how to defend myself - I won't give in and I won't give up - I will shoot until this threat is eliminated.
Finally, no matter if it is a pocketed gun or holstered gun each has drawbacks as compared to a gun in hand - which just isn't possible or reasonable, so the reality is if someone is bent on killing another person, and there are no premonitory indications, it is nearly impossible to stop that incident. For the rest of the time, we remain in condition yellow, we're aware and observant, and we're ready - if we walk into a hold-up or an assault, or any potentially violent encounter, or hear shots, or a scream for help, we wil use our brain, our training, and courage to defend as needed.