The standard mathematical formalism of cavity QED leads us to consider photons as excitations of a quantum harmonic oscillator. Although it is one of the most familiar problems of quantum mechanics, some aspects of the quantum harmonic oscillator remain difficult to visualize, particularly in the rather abstract context of an electromagnetic field. Recently, modern microfabrication and refrigeration techniques have begun to allow the creation of nanoscale mechanical oscillators which can be cooled close to the quantum regime. Despite the extreme physical differences between an electromagnetic cavity and a nanomechanical resonator, both systems may be approximated by the same quantum harmonic oscillator model. However, the conceptual consequences of quantum behavior, and the challenges to physical intuition, are quite different in the two cases. Taking a mechanical point of view therefore allows fresh insight into the quantum harmonic oscillator problem. To illustrate the connection and how it may aid our understanding of light, the mathematical parallelism between an electromagnetic cavity and a mechanical resonator is demonstrated. Current nanomechanics experiments are discussed, and some possible quantum measurements are introduced. Finally, the discrepancies between the predictions of quantum mechanics and our experience of classical vibrating beams are considered, with an emphasis on how nanomechanics may be able to offer a new perspective on the nature of photons.