A dog fence is of little value if the animal can easily jump or climb over it, worm its way through it, break it down or tunnel under to escape. A part of this decision comes from the size, strength and disposition of your dog. You may be able to step over a fence adequate for a toy breed. The world record high jump for dogs is just under 6 feet. There are no absolutes so let common sense prevail. When in doubt, choose a fence larger, higher or stronger than you think you'll need.
One of the reasons good fences make good neighbors is privacy. A wire fence may restrain your dog adequately, but does little for privacy. A solid fence made from wood, plastic or stone provides both privacy and confinement. A solid fence also blocks the dog's view of the outside world and makes it less likely the animal will want to get out to chase squirrels, people or passing cars. A solid fence also prevents passers-by from seeing in, noticing you have a dog and attempting to approach it.
What type of fence you erect or are permitted to erect may be dictated by local building codes or subdivision rules. The codes may be completely restrictive and disallow any fencing along property lines, set specific standards to be met or dictate the exact style, dimensions and material of an acceptable fence. Even in a code-free zone, meet with your neighbor before building a fence on mutual property lines. Your neighbor will be affected as much as you. Often, neighbors choose to pool resources to build a better, nicer looking fence you both like rather than accepting the fence you can afford.
In areas where fences are outlawed or look completely out of place, choose an "invisible" fence. A wire is buried a few inches under the ground surrounding the confinement area. Initially, the dog is fitted with a special collar that will produce an audible signal when your pet approaches the buried wire and will administer a brief, harmless electrical shock if it tries to cross the boundary. Most dogs quickly learn the bounds of their yard and once they learn them, many dogs never have to wear the special collar.