On Writing Books

This month I published the second volume of A Programmer’s Guide to Computer Science. One thing I’ve been asked is: why write books?

Four or five years ago, I was looking for a side project and I asked myself, what makes me unique? What can I do that doesn’t have a million other people trying to do the same thing? A number of items in my background pointed to writing a book as a likely option:

  • I used to write regularly for Scrye magazine, so I already know that I can write nonfiction.
  • My last full time job before becoming a programmer was as a math textbook editor.
  • I work as a senior software developer and have managed projects involving multiple programmers.
  • I have a PhD in computer science.
  • I enjoy teaching, but I was often unhappy with the available textbook options for the classes I taught.
  • I’ve previously published short ebooks (most notably, Healthcare in the 21st Century), so I have experience navigating Amazon’s system.
  • I’ve spoken at several conferences on computer science topics (sorting algorithms, graph theory) and seen that there are a number of programmers interested in learning these topics.

So writing a computer science textbook seemed like a good way to utilize my background and do some teaching (I do miss teaching), while also being completely separate from my day job (meaning there’s zero chance I run afoul of the non-compete clause in my contract).

I’ve advised a few people on the book writing and publishing process lately, so I thought I’d put some of that down in my blog. I want to call out that this post is not going to cover marketing your book, which is an entirely different subject altogether. You can write the best book in the world, but unless you can find a way to get it in front of people, nobody is going to purchase it.

Also, the steps below are for books that I self-published. I’ve considered traditional publishing, but chose to self-publish my books for three reasons:

  1. I keep more control over the process.
  2. I keep more of the earnings.
  3. Turnaround is faster; once the book is written and edited, it’s available for sale almost immediately.

That said, volume 1 has been translated into Russian by a traditional publisher and I may choose to work with one in the future if I have a book that I feel would be appropriate for them.


I will assume that you already know how to write, and have a topic in mind that you want to write about. You can use any writing software you like, but be aware that you may need to convert it to an acceptable format.

I wrote the Programmer’s Guide books in LaTeX, for several reasons:

  • I can use tikzpicture to generate graphs.
  • I really hate trying to typeset formulas in Word.
  • I really like how the finished product looks.

That said, creating the ebooks afterwards was a major pain. I can compile directly to PDF for the print book, but getting the content into something that could be used for a reflowable ebook was difficult. (A reflowable ebook is one where the page can be resized and the content will be rearranged appropriately, so the same book will look fine on a paperback-sized ereader or a full-sized tablet. PDF is an image format and is very much not reflowable). There are plugins to compile .tex files to html or import into Word, but I found that they did not work well with the complex documents I was creating. For volume 1 I created the html file, then manually fixed everything that didn’t get set up correctly before using Amazon’s software to create the .mobi file. For volume 2, I used Adobe Acrobat to create a Word file from the PDF, then loaded that Word file into Vellum and used it to create the ebook. In both cases, a lot of cleanup was required. (The second method did result in a nicer book, and I’ll be redoing the volume 1 ebook when I get a chance).

For future books that don’t depend on creating graphs and formulas, I’ll probably just use Scrivener or Word and avoid the whole problem. (Added bonus: spellcheck! I don’t have spellcheck functionality in LaTeX). I may consider still typesetting the print book in LaTeX after it’s all done, since I really do like the output, but I’ll probably give the print functionality in Vellum a shot first.

In between writing and editing, I’ll also be getting graphics made. Many of them I can do myself in LaTeX, but the cover and some images I outsource to a professional graphic designer (fortunately for me, I happen to be married to one).


I’ve always been a pretty clean writer; my first drafts are pretty close to most people’s final drafts. It doesn’t matter; your work needs to be edited. Preferably, it needs to be edited by somebody who is not you. It’s entirely too easy to read what you meant instead of what you actually wrote. When that’s not possible, at least put the work aside for a while so you can forget what you wrote, then read it in a different medium. For the last book I wrote, my process was:

  1. Write the chapter.
  2. Put it aside for a bit
  3. Print it out and edit the printout.
  4. Repeat step 3 until I stop finding errors. (Remember I used to be an editor)
  5. Send it to my technical editor. Make changes based on his feedback.
  6. Send it to my copy editor. Make changes based on her feedback.
  7. Convert to an ebook. Fix anything that Word, Vellum, or Amazon’s processing software flags.
  8. Read on my Kindle. Fix anything that looks off there.
  9. Publish!

As you can see, the entire process is somewhat involved. I don’t always go to this much trouble – my science fiction, which I publish under a pen name, I don’t even have an outside editor for – but for technical material in particular I really want to make sure that everything is correct. Self-published books have had a bad reputation due to being rushed out without proper editing, and I aim to have mine be as good or better than anything that’s traditionally published.


Now it’s time to publish! This is actually the easiest part of the process.

If you already have an Amazon account, you can go to kdp.amazon.com and log in. Making your book available for sale is a simple matter of filling out a three-page form and then waiting a few days for it to be approved. Here you’ll need to know things like your price, whether you want your ebook to be enrolled in Kindle Unlimited, etc. If it’s your first time, you’ll probably spend a while figuring out the best options for your book.

Amazon is the big dog in book publishing, but not the only one. I want my paperbacks to be available from places that don’t want to purchase from Amazon, and I also want hardcovers, which aren’t available from Amazon. So my books are also printed at Ingram Spark. Unlike Amazon, which is free to publish with, Ingram charges a setup fee (and a change fee if you need to make updates later) but you can generally find coupons; I have not yet paid Ingram anything except printing and shipping fees. There are also other places to sell ebooks, including Apple and Kobo. Figuring out your publishing strategy is outside the scope of this article.

Books I read in 2015

One thing I miss about being a grad student – I spent a lot of time reading! Since I got married and got a job, my reading time has gone way down, especially for fiction. That said, I’m making the effort to find time to read. This past year I also picked up an induction loop (which lets me stream sound from my phone to my cochlear implant), letting me listen to audiobooks during my commute.

So here are the books that I enjoyed in 2015, roughly organized by type. Most aren’t new, and some aren’t even new to me; they’re just books I read in 2015 and liked enough to mention.

Computer books

Soft Skills: The Software Developer’s Life Manual by John Sonmez

I wasn’t familiar with John Sonmez until I ran across this audiobook last year, but decided to give it a shot, and was glad I did. John has a good reading voice, and the book was interesting all the way through, even when I didn’t agree with him.

This book isn’t about technical skills; it assumes you already have those. Instead, it’s about using those skills to get what you want. John discusses topics like how to start freelancing, specializing as a developer, creating and selling products, and becoming more productive.

The book covers a lot of ground – over 70 short chapters – so it obviously doesn’t get too in-depth into any one topic, but it has a lot of good general advice, and the writing/speaking is good enough that I enjoyed even the topics I was already familiar with.

One problem I had with the book is there are a lot of url references, but no easy way to find them again at the end of my commute. I wrote to the author about this a few months ago and was told he intends to eventually make them available on his website.

Code Complete 2 by Steve McConnellCode Complete 2

I somehow managed to avoid picking up a copy of this classic book on software development until last month, when I get it for Christmas. I haven’t finished reading it yet, but I can tell it’ll get a 5-star review from me; unlike many technical books, it’s actually fun to read.

Simply put, this book teaches you to write good code. Good code, in this case, being defined as code that’s easy to understand and without bugs. Over the course of some 850 pages, Steve covers best practices in many areas of software construction that lead to code which is easier to read and maintain. For the most part, this is stuff that I learned in school, but it’s a great refresher and has taught me a thing or two.

I would have liked it if there was a third edition of the book – surely software development must have improved somewhat in the last decade? – but I can still tell that this will be one of my most highly recommended books.

Parenting books

Scientific Secrets for Raising Kids Who Thrive by Professor Peter M. Vishton and The Great Courses

Scientific Secrets for Raising Kids Who Thrive It’s not difficult to find parenting advice; a search for parenting on Amazon returns nearly a quarter million results. But what does science have to say about child development? In these lectures, Prof. Vishton covers the research on everything from bedtime to homework, number chains to video games.

When so much parenting advice boils down to “this is what worked for my child”, it’s nice to see evidence-based recommendations. I found the book both entertaining and educational and expect to listen to it again. The audiobook also comes with a 226-page course guidebook that covers the contents of the lectures and gives suggested readings and resources.

The Five Love Languages of Children by Gary Chapman and Ross Campbell

How do you express love in a way that the other person will understand? Dr. Chapman has a number of books about the way people express and receive appreciation through what he calls the five love languages: Words of Affirmation, Quality Time, Receiving Gifts, Acts of Service, and Physical Touch. I haven’t read any of the others, but decided to give this one a listen; it’s a mix of stories about how speaking a child’s love language helped to reach them and tips on how to speak each language yourself. What I liked was the part about how we sometimes talk past each other because we’re trying to express love in the way that we want to receive it, or the way that we’ve seen it expressed in the past, rather than the way that our partners or children need.


Phule’s Company by Robert Asprin

Phule's CompanyI used to have a number of books by Robert Asprin and this is one of my favorites; it’s unfortunately out of print but used copies can be found very cheaply. This is the first book in the very funny Phule’s Company series, about a group of military misfits, shipped off to easy duty in the backwoods of the galaxy to keep them out of the way. When Captain Willard Phule needs to be discretely punished – he is, after all, the megamillionaire sun of the man who supplies the Space Corps with most of their weapons – he’s assigned to command them. Of course, Phule takes his job seriously, and isn’t above dipping into his fortune as he molds his men, women, and aliens into an effective fighting force.

If you can’t stand puns and want your science fiction to stay serious, avoid this book. Otherwise, dive in!


How to Fail at Almost Everything and Still Win Big by Scott Adams

Somewhat of a cross between an autobiography, a book of career advice, and a humorous self-help book, this one was actually way more interesting than I thought it would be, and the audiobook was narrated well. You’re unlikely to agree with everything Scott has to say, but it will at least be entertaining, and those people looking to start a business may find his advice quite helpful.

Economics, 3rd Edition and Unexpected Economics by Timothy Taylor

I’ve always been interested in economics, but scheduling kept me from studying the subject in college. In Economics, Prof. Taylor covers the fundamentals, including both microeconomics and macroeconomics, while in Unexpected Economics he applies economics to questions you might not have considered to be part of this area. I found Prof. Taylor to be an engaging lecturer and am in the process of listening to his audiobooks for the second time.

Blocks magazine and The Ultimate Guide to Collectible LEGO Sets: Identification and Price Guide

Blocks magazineWhen I was a kid, I always wished I could afford to buy some of the big Lego sets; I particularly loved the Space Police / Blacktron / M-Tron Legos. Unfortunately I never had the money; then, once I started working and had the money, I never had the time! In the last few years, I’ve made the time to do a little building; I recently completed the new Doctor Who set (which is awesome), and my wife and I have almost finished building the Tower Bridge. For the last decade, I’ve also make a few bucks buying Lego sets on sale and then reselling them after they’re discontinued.

Blocks magazine covers all aspects of collecting, building, and investing in Legos; as a British import it’s not cheap, but it’s worth the cost. I only learned about it a few months back, and have been picking it up whenever the latest issue shows up at Barnes & Noble; subscribers also get a free zombie postman minifig after the first year. The book, on the other hand, is all about Lego sets as investments. I have my own investment strategy, but I picked up the book for fun; it talks about a lot of sets from the past few decades and how they’ve appreciated over the years, which is interesting even when it’s not useful.

The Book with No Pictures by B. J. Novak

This is, of course, a children’s book, but one that is meant to be read – aloud – by an adult. The theme is that the adult is tricked into reading the book full of silly words, and all words in the book must be read, no matter what. It’s absolutely hilarious, and demonstrates to kids that books don’t need to have pictures to be a lot of fun.