John Carmack discusses how functional programming can improve software development by addressing common flaws caused by poor state management in code execution. The interplay of multithreading exacerbates these issues, leading to potential chaos. Carmack highlights that adopting a functional programming style clarifies state management, thereby simplifying reasoning and effectively preventing race conditions in a pure functional environment. This approach emphasizes the importance of explicit state in enhancing code reliability, especially in complex, multithreaded applications.