Numerical algorithms based on variational and symplectic integrators exhibit special features that make them promising candidates for application to general relativity and other constrained Hamiltonian systems. This paper lays part of the foundation for such applications. The midpoint rule for Hamilton's equations is examined from the perspectives of variational and symplectic integrators. It is shown that the midpoint rule preserves the symplectic form, conserves Noether charges, and exhibits excellent long--term energy behavior. The energy behavior is explained by the result, shown here, that the midpoint rule exactly conserves a phase space function that is close to the Hamiltonian. The presentation includes several examples.