Sometimes cyclists ride on sidewalks when traffic gets so heavy that riding in the street would be unsafe, or maybe they just feel like riding slower than normal. That's why no sidewalk cycling laws are about as stupid as they come. They put cyclists in needless danger by forcing them into the street regardless of traffic conditions. And as an experienced cyclist I would rather that the inexperienced cyclists stay on the sidewalk out of my way. Nothing worse than to be stuck behind some novice going 8 or 10 mph for blocks with no room to pass.
There is no good reason cyclists and pedestrians can't share the same sidewalk (they do in most other countries) but there's no reason either for cyclists to use pedestrians like a slalom course when they do or otherwise ride like idiots. In general, if you
must ride on the sidewalk it's a good idea to keep your speed under 20 mph even when the sidewalk is totally empty, to go
much slower when pedestrians are around, and to cover your brake at all times just in case you need to stop quickly. Staying alert at all times goes without saying.
Never expect pedestrians to get out of your way but rather go around them instead. And if pedestrian traffic is so thick that you can't ride faster than walking speed then just get off the damned bike and walk it. Nothing more unstable than a cyclist wobbling along at a few mph.
I've ridden over 55,000 miles since college. Probably less than 5% of that has been on sidewalks but that could still mean I went one or two thousand miles on them. Never hit a pedestrian or even came close to hitting one. Since I know I'm intruding on what is basically their space when I'm on the sidewalk I'm very careful. If I see someone walking erratically I just slow down enough so as to not hit them if they happen to walk in front of me. The majority of pedestrians never even know I'm there until I pass them.