Before getting your license, you read your driver's manual and it tells you about sharing the road with both bicyclists and pedestrians.
When I rode my bicycle to work, some motherfuckers didn't respect me at all. You have to understand the dangers of riding your bike on the sidewalk. Pedestrians are at risk of getting injured (some don't look for bicyclists and take up the whole sidewalk or sometimes they could be coming from around the corner), cars pull out of their driveway/garage quickly, the pavement is un-even, and/or cars park on the sidewalk (blocking your way.)
Riding a bicycle on the side of the road can be dangerous, as well. Cars zoom by you missing you by centimeters, parked cars open doors suddenly, pedestrians trying to jay-walk could get in your way, cars making right turns on a red light don't look out for you (from a crossing street), cars making a right turn on the green light get close to the curb allowing you no space to go straight when you're going at speeds of 25 m.p.h., you could fall and the car behind you could run you over, the road is slanted and sometimes cracked (or with potholes.)
Shit... riding a bicycle is a totally different world. Although healthy and good for the environment, it's quite dangerous, so before un-knowingly speaking negative about a bicyclist, please educate yourself on the subject.