The closest you can get to living without a very high wall with spikes and electric fence right around your house, is living in an estate. Very safe one like http://www.privateproperty.co.za/irene-farm-villages-property/1049.htm Then the whole perimeter electrified in the most effective way without it looking like a jail setup. The fence is attached to alarm and patrolled…to keep them out not in : )
Other neighbourhoods close some off their roads, leaving only one road open that gets monitored by security guards that open a boom gate. Everybody in that neighbourhood club together to pay for 24 hour guard at the gate. You need to fill in a lot of papers to get authorization to do this in South Africa. This brings the crime rate inside the neighbourhood down a little bit.
Then you get neighbourhoods that simply hire armed security to patrol their area. Signs are on the outside wall of every house showing which company looks after the building. Those security companies have got lawyers on standby in case their guards shoot somebody.
Now the sad part is you still need to go out of your house to your workplace.