Quantum error correcting codes and topological quantum order (TQO) are inter-connected fields that study non-local correlations in highly entangled many-body quantum states. In this talk I will argue that each of these fields offers valuable techniques for solving problems posed in the other one. First, we will discuss the zero-temperature stability of TQO and derive simple conditions that guarantee stability of the spectral gap and the ground state degeneracy under generic local perturbations. These conditions thus can be regarded as a rigorous definition of TQO. Our results apply to any quantum spin Hamiltonian that can be written as a sum of geometrically local commuting projectors on a D-dimensional lattice. This large class of Hamiltonians includes Levin-Wen string-net models and Kitaev's quantum double models. Secondly, we derive upper bounds on the parameters of quantum codes with local check operators and discuss the implications for feasibility of a quantum self-correcting memory.