I think if you and your bike are on the sidewalk together with other people on the sidewalk with you, you should be walking the bike, not riding it. If you're moving slowly enough not to disrupt walkers, then walk. If you're moving fast enough to be a nuisance and a danger to pedestrians, you shouldn't be on the sidewalk. Simple.
However, when I've been out on tour, I've occasionally ridden on sidewalks for short distances so as not to be killed, and always in urban sprawl areas where you don't usually see pedestrians or cyclists, and only for a few blocks until I come to a turn-off/bypass. (If there are pedestrians, I walk the bike)