It's bad to masturbate in public.
Bob gets turned on while reading an erotic novel on the train ride home.
Bob wants to relieve his arousal.
Bob hurries home after his train arrives and masturbates in private.
When Bob gets off the train he goes to the back of the station to masturbate.
Bob is relieved of his pent up arousal.
Bob is caught masturbating by a guard and is arrested for indecent behavior.