Growing vegetables in beds is a good way to maximize the amount of food you produce in a given area. Beds can be densely planted because they don’t have paths through them; the soil in the bed can be built up with compost and organic nutrients over time to produce vegetables abundantly; and the soil won’t be compacted, so plants will grow larger — and may even resist pests more.

At a recent Maine Organic Farmers and Gardeners Association conference, soil scientist Fred Magdoff of Vermont told about research at Cornell University showing that flea beetles were attracted to cabbage planted in compacted soil but not to adjacent cabbage growing in uncompacted soils — another reason to grow in beds.

Beds can be nearly flush with the ground or raised to waist level, or anywhere in between. The depth depends on your purpose, your soil, your energy and your resources.

If you have well-drained soil, making beds that are nearly flush with the ground will be easiest and should work well. Simply mark the bed area and prepare the soil in that area — removing weeds, adding amendments as recommended by a soil test, turning over the soil or, better, loosening it with a garden fork or broad fork. Then avoid walking in the bed by maintaining a foot or so around the bed as a walking path.

If your soil is poorly drained, you may do better with a raised bed. Mark the area where you intend to have the bed, remove weeds, add amendments as recommended by a soil test, loosen the soil with a fork, then shovel soil from the paths surrounding the bed onto the bed. That will lower the paths and raise the bed at the same time, improving drainage.

What size should your beds be? Many gardeners make them 4 feet wide. This enables a person to reach into the bed for planting and weeding from each side, accessing the whole bed. A series of 4-foot-wide beds that extend 25 feet in length — say, five 4-by-5-foot beds — will have 100 square feet of planting area, which makes calculating soil amendments easy, since they’re often given as pounds of amendment per 100 or 1,000 square feet.

How high should a raised bed be? The higher they are, the more prone the soil is to drying out; and if the beds aren’t bordered by boards, the sloping sides generally aren’t planted and might be considered a waste of space. I’ve seen some pretty high raised beds — 1 to 2 feet high — that weren’t surrounded with boards and were producing fantastically, but they appeared to be so loaded with organic matter that they must have taken a lot of time, energy and compost to make. Gardeners should know that too much organic matter can result in excess phosphorus in the soil — a possible problem if the phosphorus runs off into surface or ground waters.

Sunset Magazine has good directions for making an 8-inch-high bed surrounded by boards (sunset.com/garden/perfect-raised-bed-00400000039550/). This is a reasonable height if you’re raising the bed to improve drainage. Anything more than this seems excessive, generally — unless you’re building a waist-high bed for someone who cannot bend over and work in lower beds.

You can surround your bed with boards or have it freestanding. Boards make it look neat, hold the soil in, and avoid the problem of sloping sides that aren’t used for growing plants and that can dry out quickly. Boards can be expensive, though (unless recycled); and perennial weeds, such as quackgrass, can be difficult to remove if the rhizomes creep under the boards.

Whether raised or flush with the ground, beds are easily covered with fabric row covers to keep some insect pests off plants and to add a little heat to the area in spring and fall; and with plastic row covers to make them into little greenhouses in cold weather — even over winter.

The Sunset article shows how to install bent PVC tubes into the beds, to be covered with row cover or plastic. The Quick Hoops pipe bender from Johnny’s Selected Seeds enables gardeners to easily bend metal pipe to cover 4-foot or 6-foot beds (another reason to make your beds 4 feet wide, or have two beds that span 6 feet). This avoids the use of PVC, which is ultimately environmentally problematic; and enables the beds to be covered over winter in the north, because metal hoops hold up better than PVC hoops under snow. See how to use these Quick Hoops at marthastewart.com/article/quick-hoop.