> I don't know why, but writing a book seems waaay more effort than churning out ~25 KLOC of tested C++.
It is. I wrote a programming book, and the code for each chapter was always a breeze compared to writing the prose.
I rationalize it by thinking of English as a programming language. It has a fantastically complex syntax and semantics, tons of undefined behavior, and a few billion interpreters out there, each with a large number of quirks and bugs.
Writing a program in English that does the more or less correct thing on all of those interpreters ain't easy.
I'm actually finding it hard because I feel like I need to re-write all the old chapters each time I write a new one.
The problem is as I go from A to B to C when I get to D I realize I really want the code to be in a different shape. But to do that I either need to make a C' where I take a timeout to explain why I'm refactoring the code before I move on to D. Or, I need to go re-write A, B, and C so they fit directly into D.
Making C` sucks because it's irrelevant to whatever the topic is. But re-writing is also a ton of work.
You could argue I should start at Z and work backward but I'm writing as I go so I don't know what Z is yet.
Ditto. I'm almost finished writing a book Ansible (self published on LeanPub), and most of the difficult sections have had the code samples ready to go for months. Getting the code organized an laid out in a logical fashion with appropriate, short intros, descriptions, and summaries requires much more effort than the code itself!
It is. I wrote a programming book, and the code for each chapter was always a breeze compared to writing the prose.
I rationalize it by thinking of English as a programming language. It has a fantastically complex syntax and semantics, tons of undefined behavior, and a few billion interpreters out there, each with a large number of quirks and bugs.
Writing a program in English that does the more or less correct thing on all of those interpreters ain't easy.