First of all, riding on sidewalks is legal here (although not encouraged overall, and pedestrians do have priority), due to the lack of bike lanes. Most of the time I ride on the road, but I will use sidewalks if:
- using road gets too dangerous;
- using sidewalk allows for a shortcut or bypassing a traffic light;
- I can use an empty sidewalk to let traffic behind me pass.
That said, usually riding on road is much faster, and might be safer as well.