Although the poet did not really mean it, many homeowners would agree. There is nothing like privacy in your backyard and a little sound barrier doesn't hurt either. There are two choices: wood versus masonry.
Wooden fences look nice when they are new. They are quick to put up and cost much less than masonry in the short term. The realistic downside is that in hot weather areas, such as most of California, they shrink, crack, discolor, weather, sag, and fall over. The sprinklers bleach out the wood, the dog digs under the fence and bites the neighbor, the perverts stare at you through the knot holes, the weeds grow through the slats, the termites have a fiesta, yada, yada, yada. Then you can put up a new one and do it all over again every two or three years. Just to maintain a decent appearance and modest lifespan requires constant upkeep.
Masonry fences are more costly in the short term, but they last virtually forever (when correctly built) with zero maintenance. If you plan to stay in your house, it makes sense to do it right. There are many choices of masonry products to suit your needs and taste. Look at the pictures below for some options. The least expensive is smooth gray block, then a smooth colored block, then a split face block. If you really want to get crazy, stone and brick are also in the mix. Capping the wall can be a basic coved mortar cap, a two inch high flat cap, or a more expensive precast concrete top that really gives a rich finish. Columns can be interspersed periodically to add variety. There really are a lot of choices. Look at some of the perimeter fences around the many newer tracts of homes and see what can be done.
Why are masonry fences expensive? Frankly, they are a lot of work. Deep and wide concrete footings have to be poured and reinforcing steel placed in the wall. Masonry units cost more to make than wooden boards and take longer to install. Each city has different requirements for 6 foot high masonry fences. Most of the time a fence between neighbors in a residential area does not require a permit or inspection. There are exceptions, however, so it is good to call the local building department and ask. Note some of the various city specifications below.
How can you mitigate the cost? Perhaps that friendly neighbor will go in halves with you. After all they will benefit just as much as you will. If you feel energetic or have access to inexpensive labor, dig the footing yourself. That really brings the cost down as masonry companies specialize in masonry, not ditch digging. Trim the bushes and trees back so that there is accessibility and move the sprinklers. The easier it is to get in and out, the less costly it will be.