I've used electric fences for horses, I've seen them used for dogs, I've tried electric dog collar on my own arm and bottom line - I don't think they're cruel at all used properly, and on the lowest settings. I also use an electric zapper when I go scuba diving. And it isn't pleasant to grab hold of when it's on but is much less painful or damaging than dropping a scuba tank on my foot. It's also less painful than getting a jet of water in the ear.
I think it is much more horrible to see a horse tangled up in a barbed wire fence, kicking to free itself but only making things worse, where as it never would have gone near an electric fence. Same with dogs and electric fences - better to have a dog that respects the boundaries than gets injured in a car accident.
And the eletric dog collar - better to have a dog that learns not to approach a snake or a bee by being stung slightly by the electric collar than to have a near death experience that snakes and bees can cause. Personally, having tried both (on me), I think the electric training collar dishes out much less pain on the lowest settings than a slip chain pulled tight. And slip chains are mandatory in my dog club and electric devices are banned.
I do object to the use of tasars on humans though. Those things don't seem to have adjustable settings ie start off gentle and can be dialed up step by step to crippling. And they don't have automatic time outs like the better electric training collars have automatic cut offs so a dog can't be zapped continuously. They'd be ok if used only instead of a gun fired between the eyes, but it seems that this is not how the police force use them.
Just like a baseball bat - in the wrong hands electric devices can be cruel and inhumane.