A fence is something built like a wall, often made of metal or wood, to keep something in or to keep something out. It differs from a wall, which has a foundation.[1] Fences are usually supported by fenceposts. Fences can be large or small. Many are used in gardens or farms. Some are portable. A fence differs from a wall in not having a solid foundation along its whole length.
Alternatives to fencing include a ditch (sometimes filled with water, forming a moat).