For the specific aim of hurting lots of people in close proximity who have been taken by surprise, then bombs are more efficient. However guns are concealable, user friendly, mechanically reliable, easy to obtain (in the US), easy to resupply (in the US), much more precise, have easily available training, they don't degrade as quickly and they work at range.
I can make a bomb anywhere on this planet, mostly, well maybe not in Ireland as they already use all the "good" stuff
It's not that hard.... fill it with some nails, add some toxic chemicals and off you go hell's kitchen.