The cover of my book, Learning to Program

About a year and a half ago, I published a book with Pearson/InformIT. The book is called Learning to Program. Since publishing, I have had a few people ask me about the book writing experience. So, for anyone thinking about writing a book and anyone who is just curious what it is like, here is what I went through. Disclaimer: My book is a technical non-fiction book; I’m pretty sure most of my process wouldn’t work well for fiction writing.

“Maybe I Should Write A Book…”

If you ever find yourself thinking these words, beware. You better think it over before you make that leap. There are a few things to consider before you start writing a book:

  • Writing a book takes a lot of time. Like, all of your free time, and then some.
  • If you are writing a technical non-fiction book, you will not make very much money, even if your book is a breakout success in the technical non-fiction category.
  • If you are writing a fiction book, you will also probably not make much money, but the potential upside is much higher for the rare few who make it big.
  • Self-publishing is a lot more work than just writing. Finding quality copy editors, content editors, layout designers, cover designers, marketers, and distributors is no easy task. Publishers do more than just print your book.
  • If you get a publisher, they will probably not do much marketing for you (unless your book is already successful, ironically), so get ready to do some marketing.
  • If you want a website to accompany your book, you better be ready to make it yourself.

The Proposal

I decided I wanted to work with an established publisher (see above), which meant I had to put together a proposal for my book. Most publishers expect a proposal to consist of:

  1. One completed chapter (I think they usually want the first chapter. My submitted first chapter became the third chapter of my book, though).
  2. A complete outline of every chapter of your book. That means chapter titles, headings, and subheadings for the entire book (it’s okay if these change as you go).
  3. A written proposal. Each publisher expects a slightly different format for the proposal, but they basically all want to know the target audience, why “now” is the right time for this book to be published, and why you are the right person to write it.

I sent my proposal to 5 different publishers (the email you use to send to publishers shouldn’t be too hard to find on their respective websites). I got no response at all from one, a definite “no” from another, a “maybe” from two, and one “yes”. All you need is one yes. I signed my contract on Christmas Eve 2013.[1]

Signing a Contract

Before you go into the contract signing process, remember what you should expect out of your book. Specifically, remember that if you are writing your book to try to make a lot of money, you are wasting your time. You should expect to make about 10% of the profit on each book sold. That doesn’t mean 10% of the sales price, but 10% of the profit that the publisher makes on each book. Ouch. And you generally make less on copies sold internationally (about 5%). Some publishers will probably give you a larger cut, and I’m guessing that repeat authors are in a better position to negotiate higher percentages. Regardless, you won’t make much money from your book, so don’t get too caught up with these percentages.

The Advance

You should, however, get some sort of advance if you are working with a publisher, and the advance will probably be paid out at specific milestones as you complete the work. The advance, as the word implies, is an advanced payment for expected future royalties. My contract stipulated that if my book didn’t sell enough copies, I would have to pay back the portion of my advance that I didn’t earn. I was slightly concerned about this, but my editor assured me that they weren’t in the business of signing books that wouldn’t sell enough copies to at least pay for the advance. I’m now well past that point, so my worries are gone.

My Work, My Rights?

What you should focus on in the contract is the rights to the work. I believe that most (maybe all) publishers require you to sign over the copyright entirely. In other words, your work becomes their property. I remember getting some explanation about why this is legally the easiest way for publishers and authors to work together, and I think that’s probably true, in the eyes of the publisher. One piece of my contract that I did negotiate was that the copyright be returned to me if my publisher decided the book was no longer worth printing. If any authors reading this have managed to negotiate the contract for their first book better, I would be very interested in hearing how they did it.

The Writing Process

The writing process is either the most fun or least fun aspect of writing a book. If you would consider it the least fun part, then book writing is definitely not for you. The writing process takes a lot of time. Here’s how it went for me.

Write the Entire Outline

I was a bit surprised at how little my editor asked me to change my book before I got started. He requested that I switch the order of a few chapters, and told me that my book needed to be at least 300 pages (apparently shorter books are much harder to make profitable). So, I added a few chapters to the outline, and then got started. I spent a lot of time at the beginning of the process writing out a thorough outline of my book. As I mentioned above, I wrote out chapter titles, headings, subheadings, and in some cases sub-subheadings. This process let me see how the book would flow as a whole, and helped me ensure I was covering all of the necessary information. Then, when it came time to do the actual writing, I didn’t have to write an entire book, I just had to fill in the pieces of the outline, like writing a whole bunch of short essays that happen to flow together (quite nicely in my opinion :)).

One thing I neglected to do while writing my outline was add a few notes about what I planned to put in each section. I did my best to keep the book interesting by giving interesting names to my chapters and headings. Unfortunately, when I came back to some of these cleverly named headings, I forgot what I was hoping to write in them (e.g. “{1,10}: Make Your Own Super Powers” in the RegEx chapter; what in the world did I mean by “super powers”?). If I were to write another book, I would spend a little bit of time writing out a few thoughts next to each heading.

Illustrations, Images, and Screenshots

Technical books are boring. Even interesting technical books are boring, unless you add some variety. I added some stories, a few inside jokes, and references to The Simpsons, but I think the most effective tool is visual. I spent a lot of time drawing for this book. Some of my drawings are actually printed in the published version of the book (including an XKCD-like comic and an excellent drawing of a VW Beetle). A cartoonist friend of mine redrew one of the comics for me, as well. I also added a lot of screenshots, and a few other images. Adding all of these images to the book took a lot of time, but I think it made the book much easier to read. Images also take up quite a bit of page space, which helped me reach my 300-page goal.

When to Write

The harsh reality of writing a book is that the deadlines are tight and there is a lot of content to write. I had to write over 10 pages per week. When can you find the time to write all of that, and still do your full-time job? I don’t know how other authors do it, but I pretty much sacrificed my sleep and free time for 4 months. I woke up around 5:00 AM every day and wrote until about 7:00 AM when the rest of my family woke up. Then I would get ready for work and ride my bike to the train station. Then I would write as much as I could during the 15 - 20 minute train ride. I would do the same on the train ride back home. Then I would spend the evening with my family. Most nights, after I put my kids to bed, I would write for another hour or so. I also spent quite a bit of time on Saturdays writing. Sometimes at work, I would write a paragraph while I waited for code to build or check in. I also spent every InDay writing.

As a side note, I wrote my book in a git repository, and I would make regular commits. I believe I created branches for each chapter. I also wrote the book as HTML using Atom.

Reviewers, Editors, and Publishing

I would submit chapters to my publisher as soon as I finished them. I would read them over once, but they were still in pretty rough form when I submitted them. I figured, they’re only going to give me 10% of profit, I’ll let the reviewers and editors do some work ;). The technical reviewers did great work and caught some pretty serious problems with my book. The copy editors were amazing, finding errors and improvement and inconsistencies I never would have imagined. The content editors did a great job of making the book feel polished. When I was considering self-publishing, I didn’t really consider the value of professional editors, but having seen their work, I’m glad my book passed through their hands before being given to the public.

I was given several opportunities to look over my book before it was sent to the printers. Overall, I’m really happy with how it turned out. I wasn’t crazy about the cover photo, but it I think I chose the best of the options I was given, and I’ve grown to like it. Finally, almost 11 months after I signed the contract and nearly 7 months after I finished writing, my book was printed. Pearson sent me 10 copies, which I received a few days before the pre-ordered copies started arriving from Amazon. Holding the printed version of my book for the first time was a surprisingly emotional experience (I’m glad I didn’t go the eBook only route). Perhaps the only thing more rewarding has been to interact with people who have had success in learning to program, and they have given some small amount of credit to my book.

Royalties

I want to reiterate, don’t write a book for the money. Nicholas Zakas said his most successful book made him enough money to buy a used car. I don’t mean to brag, but I think I could buy at least 2 cars with the money I’ve made. So, yeah, I’m not in it for the money. But, the royalties are pretty great, because they just keep coming, month after month. Most months it’s just a small amount, but it’s still pretty great to keep getting paid for work I did 2 years ago. Additionally, royalties are taxed pretty favorably, so that helps.

Readers

The best part of writing a book is the readers. I’m really glad I live in the age of Amazon and Goodreads, where I can see feedback from my readers. I also occasionally get emails, tweets, and instant messages from readers asking for help. At first I (arrogantly) thought that I wouldn’t have enough time to help every reader who asked for help. I only get about one of these types of requests per month, though, and I’ve really enjoyed being able to interact with my readers and help them get into programming. That was the point of the book in the first place. It was a lot of hard work, but I’m glad I wrote it.