Caning, as it's practiced in Singapore, may be overly severe. Offenses such as spitting on a sidewalk or small time vandalism may result in a caning.
However, I do agree with Robert Heinlein's viewpoint that public flogging can be highly beneficial. For young first offenders a brisk flogging makes more sense than incarceration.
For maximum benefit, floggings would be conducted regularly at set dates and times, in full public view on the town square. The name of the offender, his offense, and his sentence would be read aloud. An expert would then administer the number of lashes ordered by the court.
Immediate intense pain and public humiliation will produce far more of a deterrent effect in youthful offenders than probation or incarceration. Besides being more effective at deterrence, flogging costs a lot less than the alternatives.
.