Many years ago during a canoeing rally I got an occasion to use the sling for self defence. One night when we were siting around the fire, some bad guys started to lob stones, quite big stones over our heads. The stones were landing badly close to us hitting the ground, trunks and a few canoes. It wasn't funny at all. We immediately took shelter behind the tries.
After a moment I noticed that they are were using slings as they were able to toss big stones so far and high. To me it was a kind of gentle lobbing. I recalled that I had a sling in my backpack (I hadn't used this before there and no one knew about it). I grabbed my backpack, a few poor shaped stones and a big potato that were around of the fire and went a few dozen meters along the bank in order to hide myself in the dark.
When I found a good place between tries I started slinging in the direction where I heard noises they were making. I was slinging hard and straight but aiming high under the rascals' heads - not directly against them. The bad shaped stones were making scary noises and loud crackles and ricochets among the treetops. There was only three or four shots - I had no more stones. The potato was too huge for my sling so I hurled it by hand with full power directly into the place where I detected them. Just after the throw we heard something like "o... f**k!"

And it was finish of their bad action. We quickly launched some canoes in order to catch the hooligans but there was nobody on the other bank when we got there.
After the adventure I was asked asked by my fellows what I had done. My only answer was - "secret of Shaolin"

It was funny to keep them curious. Just a little story.
In this case the sling was effective because of a psychological effect. But I think the sling isn't a good tool of self defense in close attacks. Sometimes in stress even handgun can't help. Some years ago they showed a real movie where a bank robber wasn't able to hit a bank guard which was struggling on the floor just 2 meters away. The robber run out whole magazine and didn't hit the guard. I agree, the best way is to avoid direct confrontations as long as possible. Self defense is an extremity.