I have been to Yosemite NP three times this year: first time with Anil on the Memorial Day Weekend, second time again with Anil and my parents at the end of July and third time just now, at the end of October. My very first visit to Yosemite NP was in September of 2007 with Ania and Molly: link.
Seeing the park during several different times of the year I have to conclude that the best time to visit is late fall (end of September - mid of November) as the weather is still good then and the number of tourists falls down drastically. Early spring might be a good time to visit the Yosemite Valley, but the rest of the park will most likely be not passable then yet because of the snow. If you decide to visit the park in the late fall it might be a good idea to sleep in a "heated and insulated tent" as we did it this time around, as nights get really cold. If you have a good sleeping bag then it might be still possible to sleep in your own tent.
Below are several photos taken during the last visit to Yosemite NP.
Vernal Falls (much less water than at the end of July!):
Beautiful fall morning nearby our campground at Curry Village:
Upper Yosemite Fall:
Half Dome and Monika (from North Dome trail):