This paper presents several classical mechanical systems with nonholonomic constraints from the point
of view of sub-Riemannian geometry. For those systems that satisfy the
bracket generating condition the system can move continuously between any two given states. However,
the paper provides a counterexample to show that the bracket generating condition is not also
a sufficient condition for connectivity. All possible motions of the system correspond to curves tangent
to the distribution defined by the nonholonomic constraints. Among the connecting curves we
distinguish an optimal one which minimizes a certain energy induced by a natural sub-Riemannian
metric on the non-integrable distribution. The paper discusses several classical problems such as the
knife edge, the skater, the rolling disk and the nonholonomic bicycle.