Traditional image and video compression techniques, based on handcrafted transforms and distortion metrics, have proven effective in earlier applications. However, their inherent limitations in coding efficiency and perceptual quality become increasingly evident when faced with the demands of diverse and semantically complex visual content. With advances in deep generative models, generative coding has emerged as a promising alternative, offering improved efficiency, perceptual quality, and flexibility. However, it also poses challenges in complexity, interpretability, and deployment. This survey provides a comprehensive overview of generative coding. We formalize the problem and highlight its theoretical links to generation and compression. Representative methods are categorized by model type and technical evolution. Finally, we further present comparative experiments and discuss key challenges and future directions to guide ongoing research.