We’ve all had an experience in our lives where we were exposed to someone with whom we simply did not click. Whether it was a classmate or coworker, everyone knows someone who is the oil to their water. Despite your best efforts, there are some people in this world you are going repel or who will repel you. To this rule, plants are no exception.

Although it may be tempting to dive right into planting a veggie garden, this truly in an endeavor that requires planning in advance. Even though plants seem like peaceful beings that will not have conflict amongst themselves, the opposite is actually true. Much like some people cannot co-exist, the same holds true for different plants. Instead of coexisting peacefully, plants can actually behave parasitically towards others, hence the importance of planning your planting according to these behaviors and more.

Since space is often an important factor in gardening, we are naturally inclined to make the most of the planting area we have. In order to do so and still have fruitful plantings at the same time, there are a few things to know about plants that are friends versus foes. Take for example the sunflower. As pretty as they are to look at and as much as you might like to harvest their seeds, sunflowers are an anti-social plant if ever there were one. Instead of amicably sharing space, sunflowers release toxins via their root system that can impede the growth of other plants nearby. The reason for this is so the sunflower can suck up nutrients in the soil for themselves. The sunflower is not one to willingly or readily share space, and it is not the only one.

Unfortunately for gardeners with limited space, it is not only the sunflower that may protest to having certain neighbors. Members of the bean family are another example of a plant that requires the careful selection of neighbors. Beans should not be planted near onions, leeks, garlic, chives, peppers, or any vegetables that sprout from bulbs. Another couple of vegetables that do not enjoy the company of peppers are cauliflower and broccoli, which take it even further and don’t share space well with zucchini, squash, pumpkin, tomatoes, and strawberries. In response to being picked on by cauliflower and broccoli, tomatoes stage a protest of their own by objecting to the presence of cucumbers and cilantro. Cucumbers, on the other hand, are not friends of potatoes. Then, when it all finally starts to come together, make sure you haven’t forgotten about the peas who behave much like beans and have the same nemeses. On the bright side, however, spinach is a pacifist that can live comfortably with neighbors of all types.

Though it may seem silly, there actually is a bit of science behind the unwillingness of different plants to share space. In large part this boils down to soil pH and who needs what to survive. Different types of plant release different kinds and quantities of various compounds into the soil which can change the pH. These compounds, such as potassium and nitrogen, can be detrimental to certain plants depending on levels present, so it is important to plant neighbors whose compound output and tolerance go hand-in-hand. Something else to consider when planting is the possibility of cross-contamination and how that can damage vegetables. For example, corn and tomatoes are plagued by the same type of fungus, so having these two side by side can wipe out both crops if one were to become contaminated due to ease of spread amongst them as neighbors.

Last but not least to consider when planning your garden is shade and sunlight. Though this may seemingly go without saying, it truly is important to plant items of similar size near to one another. If you plant tall plants next to short plants that require copious amounts of sunlight, the taller plants will deprive the smaller plants by creating shade, resulting in failure to thrive.

Though it can be overwhelming at times, knowing which plants make good neighbors is essential to the success of every veggie garden. The less space you have to work with, such as in urban gardens, the more important this is. Mapping out your garden ahead of time will save you a lot of heartache in the end as your plants grow and produce instead of faltering as a result of willy-nilly planting. They say that if you want to be happy for a lifetime, you should plant a garden, but be the sure garden you plant is happy, too.