Through a combination of trial-and-error and research, I've learned that you can't skimp on sunshine when it comes to certain crops. In particular, summer squash needs an extremely sunny spot. Last year, I planted in a location that got a bit too much afternoon shade and didn't get a single zucchini. (How embarrassing! I mean, zucchini is supposedly the easiest vegetable to grow.)
This year, I've got my squash, green beans and corn in my sunniest plot, just above the cactus patch. These crops should grow well together, since corn and beans grow up and squash grows out. That's the idea, anyway. So far, all three crops doing well, and I'm thinking this year's squash crop will be less humiliating.
I've found that other summer veggies, like peppers and carrots, can handle a bit more shade--although not too much. So, I've got those guys growing in slightly shadier spots. I'm lucky in that Southern California summer days are long and hot, so almost any spot is sunny for a couple of hours. Still, when planning your garden, I recommend you take into account various crops sunlight needs as much as you can.
A good reference for figuring out where to plant your veggies is Burpee's The Complete Vegetable & Herb Gardener. It's a giant reference manual that gives good advice on where to plant almost every vegetable in your garden, alongside detailed information on fertilizer needs and other important tips. Despite my trail-and-error tendencies, I have found this book to be extremely helpful.
To be honest, though, everyone's garden is different. I think you have to keep testing different crops in different areas until you find the right spot and configuration for ideal production*. Tree trimming regularly would also probably help.
And, obviously, container gardening helps solve some of my space and sunlight issues. I'm growing tomatoes almost exclusively in containers this year. This will save me space, and allow me to move my plants to sunnier--or shadier--spots on the patio as needed.
* Once I find the right spot for my in-ground veggies, I'll have to confront the whole issue of crop rotation--which is daunting considering my limited space. Perhaps since I'm growing small crops mixed together, it won't be too bad to grow the same crop in a very similar location the following year. We'll see...