The Invent with Python Blog

Writings from the author of Automate the Boring Stuff.

Comments on John Resig's "Programming Book Profits" (and on Self-Publishing)

Tue 11 June 2013    Al Sweigart

John Resig is the talented creator of the jQuery JavaScript Library and the author of the excellent book Pro JavaScript Technique. In January of 2008, he wrote a blog post entitled Programming Book Profits where he lists several things he wish he knew when starting out writing a programming book.

I wanted to repeat some of the things he said in that post with my own commentary, coming from the perspective of someone who has self-published technical books rather than going through a traditional publisher. I've used to publish all three of my books, and I haven't had any problems with them. A special thanks to John for giving me permission to use his article here.

A summary of my points:

  • Publishers don't do all that much to promote your book, and don't offer an advantage over self-publishing here.
  • Writing interesting blog posts is a much more effective way to get publicity than buying advertising.
  • Christmas will effortlessly triple your sales, but have your book out there well before the holidays.
  • I use as my self-publisher, and haven't had problems with them. The books only sell through Amazon, and directing readers from my book's site to the Amazon page using the Amazon affiliate program gets a little extra cash per sale.

When you negotiate a contract with a publisher, and you receive an advance, that’s an advance of your future profits. I had no idea why I never realized this until after I received my first statement and saw -$3000 listed as my payout. It makes a lot of sense, in retrospect – but it was just a silly thing that never quite clicked with me.


Advances are usually pretty low (I think Apress’ typical one was $5000 for a first-time author). In talking with authors at other publishers you can usually expect something in that range – maybe slightly higher.

One thing about self-publishing is that there is absolutely no advance. 100% of the work needs to be done upfront before you see a dime. I wrote my books as a side project while I kept my day job. I don't currently have any plans to drop my job to write full time.

No one buys eBooks. You’d have to be pretty... special... in order to not be able to find a free ebook of Pro JavaScript Techniques.

I've made my books freely downloadable under a Creative Commons license, which I credit entirely with the commercial success of the books. Had I simply made them available for purchase on Amazon, I don't think anybody would have taken a chance with them. Piracy of the books by readers is not a concern for me, so much as piracy of other people selling my books (I've sent one copyright infringement notice to Amazon when someone posted the rough draft of "Hacking Secret Ciphers" for sale as an ebook.)

Ever wonder how an author tracks how many books they’re selling? Guess what, he doesn’t! It’s a massive mystery! When I chatted with my editor, on a number of occasions, most of the conversations just ended with him making a sad face and saying “just watch your Amazon numbers.” So that’s what you do – you watch your Amazon page like a hawk, trying to divine some special meaning from the crazy fluctuations in your sales rank.

CreateSpace has an advantage here, as I can see exactly how many of my books have sold. The website reports sales on the same day of the sale. And while the Amazon ranking is a good general indicator, but it's easy to waste a lot of time constantly checking on your rank.

While CreateSpace gives a slightly better rate for sales through a custom eStore, I just use the Amazon links on my book's website since it gives a more credible place to purchase the books from. I also signed up for Amazon's Affiliate program to get some extra cash for directing the user there. I only use the eStore that CreateSpace provides for educator discount codes that I set.

A couple rules of thumb that Chris Mills (my editor) taught me for tracking your Amazon sales rank (for programming books, especially) is: If your rank is < 10,000, you're doing fantastic, < 20,000, you're doing very well, < 100,000, reasonable, anything else and you're effectively dead. Tracking my ranking over the past year it's been consistently in the 10-20,000 range, with occasional dips into the < 10,000 range. JavaScript: The Definitive Guide is always < 5,000 (for comparison).

These numbers seem about right in my experience. As of June 2013, "Invent with Python" is around 10,000, "Hacking Secret Ciphers" is around 50,000, and "Making Games with Python & Pygame" is around 70,000.

The vast majority of technical books will never sell more than 4000 copies. Unless you’ve really tapped into something good, are targeting a huge audience, or have done a really outstanding job, it’s likely that your book will sell around the same amount.

I've been fortunate to hit on a good market: programming education. I'm convinced that my books don't sell because they are Python programming books, but rather because they are books specifically for beginners. This all happened at the same time that online education and "learn to code" sites like Codecademy came in vogue.

Publishers do very little promotion of your work. I guess, unless, you’re going with a real powerhouse like O’Reilly (where they can rope you into conferences and all sorts of promotions) most technical publishers have little leeway outside of “sending free books to influential people and praying that they’ll blog about them.”

This is where I thought traditional publishers would have an edge over self-publishing, but I keep hearing how publishers don't do that much (if anything) to promote the books they publish. My main promotion strategy has been to write blog articles on programming topics (with ads for my books in the sidebar) and then submit these posts to Reddit and other social media sites.

I've purchased advertising on Reddit before, but even after targeting specific subreddits (such as /r/learnprogramming and /r/python) I found that it wasn't nearly as cost-effective way to bring in traffic as writing a good blog post. It taught me that blogging is a serious profession. Though how successful a given blog post will be has been very difficult to predict.

I also offer to send out review copies for free to people in exchange for an agreement to write an Amazon review within 60 days. Historically about 2/5 of the people I send books to actually write them, but I feel like it's worth the cost.

Releasing your book before Christmas is awesome. Geeks love to add books to their Christmas lists (they’re cheaper than gadgets and safe for family members to acquire). The book was released December 11th and yet it still sold over 2,000 copies in the remaining 20 days of the quarter, in 2006.

I can't stress this enough: Christmas is a big deal. My book sales effortlessly tripled in December (though they also had been available for some time before the holidays, so they had reviews and word of mouth).

Don’t force your friends to buy your book, authors always get a massive pile of their book to give away at user groups, etc. – hang on to some and save your friends $30.

I can buy copies of my own book at cost from CreateSpace (which come to about $8 or $10 a copy when shipping is added.) I use this for gifts and review copies, since my agreement with CreateSpace says that direct sales should go through them. (Which makes sense.)

I’m not 100% sure what the “licensed rights” are, mentioned in the printout above, but I think it relates to translated copies of the book (I’ve been told that there’s a Chinese version – there may be others).

Being a book available under an open license has given it the credibility where people have contacted me volunteering to translate it. Organizing my files to help facilitate translation has been a lot of work (and I'm still in progress with it). Also, most people only translate the first few chapters before giving up (understandably so, it's a lot of work to translate an entire book).

When you go over a certain amount of profit publishers will hold some in “reserve” as a measure to counter-act returned copies, from the distributors. I’m not sure how much of a real concern this is, but it seems sketchy to me.

Occasionally CreateSpace has had to modify my sales figures, which I assume is to account for returns or miscounts. This has been a rare occurrence though (maybe two or three times in the last few years).

I also exchanged email with Gayle Laakmann McDowell, the author of Cracking the Code Interview. She's written up a lot of what she learned about self-publishing here: Everything I Know About Self-Publishing. I highly recommend reading it if you are writing a technical book. I also previously wrote a blog post on this topic: Lessons Learned From Writing a Technical Book to Teach Programming.

One last note: 100% of my author royalties for Hacking Secret Ciphers with Python are donated to the Electronic Frontier Foundation, the Creative Commons, and the Tor Project. (I later learned that Beautiful Code by Andy Oram and Greg Wilson have all author royalties donated to Amnesty International.) I do this not just because these are organizations that deserve support, but because I'd like to set an example for others to follow. Writing programming books isn't often a very profitable enterprise (I still have my day job). Rather than a source of income, I see these books as a way to help others educate themselves.

I end this post on programming book profits by saying that the "Thank You" emails I get from readers has been fare more enriching than any royalty check. I can only encourage others to put their talents to similar use.

Learn to program for free with my books for beginners:

Sign up for my "Automate the Boring Stuff with Python" online course with this discount link.

Email | Mastodon | Twitter | Twitch | YouTube | GitHub | Blog | Patreon | LinkedIn | Personal Site