A deterrent.  6-8 weeks or even 6-8 months in a jail can curb your addictions and help flip that reset switch.  The city can move you to the CORT system or into the hands  of St. Vincent for housing if thats what you want.  If you want to continue hanging out with your buddies smoking weed and drinking beer and being a nuisance on the street corner, then jail would be a terrible place and you'd leave town or change your behavior.