# John Carmack - Functional Programming in C++ (Highlights) ![rw-book-cover|256](http://www.sevangelatos.com/content/images/2018/10/john_carmack.jpg) ## Metadata **Review**:: [readwise.io](https://readwise.io/bookreview/24565157) **Source**:: #from/readwise **Zettel**:: #zettel/fleeting **Status**:: #x **Authors**:: [[John Carmack]] **Full Title**:: Functional Programming in C++ **Category**:: #articles #readwise/articles **Category Icon**:: 📰 **URL**:: [www.sevangelatos.com](http://www.sevangelatos.com/john-carmack-on/) **Host**:: [[www.sevangelatos.com]] **Highlighted**:: [[2023-02-20]] **Created**:: [[2023-02-24]] ## Highlights - A large fraction of the flaws in software development are due to programmers not fully understanding all the possible states their code may execute in. ([View Highlight](https://read.readwise.io/read/01gspej4pf5d0amk369maq6zkz)) ^479075512 - Programming in a functional style makes the state presented to your code explicit, which makes it much easier to reason about, and, in a completely pure system, makes thread race conditions impossible. ([View Highlight](https://read.readwise.io/read/01gspejcmfqmb5438wmgjxkzcg)) ^479075646 - Moving a function towards purity improves the code, even if it doesn’t reach full purity. ([View Highlight](https://read.readwise.io/read/01gspf0fb6najvmpgatfwn0zpr)) ^479082392 - Avoiding the worst in a broader context is generally more important than achieving perfection in limited cases. ([View Highlight](https://read.readwise.io/read/01gspf13z21w00ahxfb8d9yarv)) ^479082429 - A significant mitigating factor is that performance today means parallel programming, which usually requires more copying and combining than in a single threaded environment even in the optimal performance case, so the penalty is smaller, while the complexity reduction and correctness benefits are correspondingly larger. ([View Highlight](https://read.readwise.io/read/01gspfx6n3cn1ww0pg762hhgeg)) ^479085493