Some state include "mandatory sentences," which require judges to impose specific and identical sentences on all defendants who violate those laws. Mandatory sentencing laws are a response by state legislatures to their perception of the public's desire to end judicial leniency and treat alike all people who break the same law. Federal law used to prescribe mandatory sentences; these are now used more like guidelines.
More commonly, criminal statutes do not carry mandatory sentences. Rather, judges can take a number of factors into account when deciding on an appropriate punishment. For instance, judges may consider the defendant's past criminal record, age, and sophistication; the circumstances under which the crime was committed; and whether the defendant genuinely feels remorse. In short, mandatory sentence laws "fit the punishment to the crime," whereas judges prefer to "fit the punishment to the offender."