Plant size and root depth vary. It is important to know the end size of the plants you intend to grow and to place them in appropriate locations and containers. This keeps from having to dig up and move the plants, potentially harming your produce. Once you decide to grow in a large garden box or garden area, space is not as much of a concern.
Pot Friendly Plants:
https://www.diyncrafts.com/7137/food/35-easiest-container-pot-friendly-fruits-vegetables-herbs
Indoor Plants:
https://morningchores.com/growing-vegetable-indoors/
Containers to Garden:
This requires continual movement of plants as they grow.