Playing With Chaos: The Book

Apr 29 2012 Published by under General, JavaScript, Kindle, Technology

Well, the title gives it away, so I just need to elaborate. I had so much fun and did so much research and wrote so much code for my Playing With Chaos presentation, and it went over so well and was very popular. But in the 45 minutes I had last week, or even in a full hour of talking, you can barely scratch the surface of the simplest bits of math or code and only show a few quick images or demos of each example. And there were lots of other examples that I didn’t even have time to touch on. I would love to be able to cover all the topics I had in mind, and go over each one fully enough, with well explained code. Thus, I’ve been thinking of writing a book based on the presentation.

The truth is that I’ve been thinking of writing this book for about a year. But doing the presentation at Beyond Tellerand – Play! solidified the idea. Here are some details about my plans:

1. I’m going to self-publish the book. I’ve been really interested in self-publishing for a while. This will be an experiment to see how well it works for me. The biggest thing I’m concerned about is the editing process. I’m sure I can dig up a technical reviewer or two, but the copy editing phase where someone at the publisher fixes all your spelling and grammar and unifies your tenses and persons and numbers, etc. is invaluable. I actually do understand grammar pretty well, but in a longer piece of writing I can lose track of the style I’m using and jump back and forth. It will take an extra reading or two with extra attention on this stuff to get it down. Or perhaps I’ll find someone willing to help me out on this point.

2. I’ll be going through the Amazon Kindle publishing service. I think this offers the best form of distribution, discoverability, protection, commerce, etc. In addition to being able to read the book on any existing Kindle, it can be read on any iOS, Android, Windows Phone 7 or Blackberry device and on any computer via standalone reader apps or the Kindle web app. This also allows me the option to publish through other services such as B&N Nook and Apple iBooks as well. In addition, there are services that will publish hard copies of your Kindle book on demand for those who want to kill trees. šŸ™‚

3. I will not be doing a Kickstarter project for the book. I don’t believe most books require any kind of start up capital. Unless you need to do some kind of heavy research, travel, or buy some expensive equipment, or quit your day job and write full time, there is really no up front cost. You sit down and write the book. The only thing I might need to pay out for would be a technical reviewer and/or copy editor, and that would be later and something I’m sure I can work out. I’ve contributed to funding two books over the last couple of years on Kickstarter and neither one of them has yet seen the light of day. It leaves the author in an odd position of being responsible to many people, but with no single person invested so heavily that they are going to bug him daily to meet deadlines. I’m not even sure there is any penalty if you get funded and never release the thing you were funded to do. Do theĀ contributorsĀ eventually get their money back if nothing happens?

4. The examples will be done in JavaScript with HTML5’s Canvas. This may or may not be your favorite platform, but I feel like it offers appeal to the widest potential audience. Even if you’ve never done any serious JavaScript, you can fire up a text editor and browser and be coding and running HTML/JS in minutes, for a total cost of $0.00. If you’ve done any programming in any other language, JS is a piece of cake to pick up, and generally easy enough to convert into the language of your choice. Few other languages require so little monetary investment, so little setup for a coding environment across the boards, and such a low learning curve for the language itself.

5. Right now, the TOC stands at 12 chapters, but that could change and rearrange. Right now I’m most of the way through the introduction chapter and have been working on developing a base package that all the examples can use to prevent massive duplication of code. The goal is to not rely on any major third party libraries just as jQuery, etc., and not to create something so complex that it becomes a heavy dependency. Basically, it’s just some boiler plate to grab the canvas, 2d context, some properties like width and height, and various utility functions for commonly used operations.

So watch this space for various updates over the next few months. Maybe even some teaser images or live demos. I haven’t really got a solid deadline in mind, but roughly hoping to be done by the end of the summer.

10 responses so far

  • Hey Keith,

    Please consider this feature request:
    Most .js books or training start w/ out a .js library. Hence the student/reader is doing a lot of beginner pluming/hello world stuff and not getting to the point of what’s being done.

    The alternative approach (my request for your book) is that you pick a .js library to use.
    Ex: three.js, easel.js, or (endorsed by creator of or similar popular libs. (not .jquerry, it’s dom centric).
    Even if in different chapters you use a different popular lib. No need to endorse one.
    The reader gets a completely different feel if you start/assume a library(s), it’s more intermediate. Just start by saying: books assumes reader knows how to do classes/interfaces/amd/require.js and will use a canvas library and move on.

    thx for considering this.

    • keith says:

      Vic, thanks for the suggestion. I agree that books that are built around the author’s personal library wind up being books ABOUT the author’s personal library. That is not my intention at all. I don’t intend to create any kind of “library” per se, just extract some common functions and properties so they don’t have to be typed over and over. All the code itself is going to be low level, basic JavaScript using the Canvas drawing API. Perhaps you’ve seen my examples at , where I make use of a personal library I’m working on. I’m definitely not planning on using that library or anything similar in the book.

      Out of the libraries you mentioned, easel.js is a large, complex framework that attempts to replicated the Flash display list in JavaScript. An impressive feat, but severe overkill for the purposes of the book. three.js is an Open GL 3D library, way beyond what I need, and moobile.js seems mostly about UI controls. I’m sure there are others more fitting to the job at hand, but I’d still not enforce any other library on the reader. 99% of the graphics code will merely be drawing rects, circles, or lines to coordinates on a canvas. Some occasional pixel setting in imageData. Nothing that requires any heavy third party library.

  • Dev says:

    Great news. I’m looking forward to it. Will definitely get a copy – probably a dead tree version if it will be available!

  • Really anxious to see how the self publishing goes.

    I agree kickstarter isn’t quite the right thing for a book, but maybe pre-sales? Maybe people with pre-orders could get advance chapters (and help proofread/tech-edit!). I have no idea what makes a good online model for content creators, but I’m sure many of us would have no trouble committing to a copy in advance – if that makes sense for you.

    Best of luck with it : ).

    • keith says:

      Robin, thanks. I was thinking very much along the same lines. Just a few dozen pre-orders would help a lot on miscellaneous expenses, such as a professional copy editor. I’ll be giving this a lot of thought as it moves forward.

  • C4RL05 says:

    Awesome news, Keith. I love your books, the way you explain things feels just right. Thanks for this, I’ll be preordering it.

  • James says:

    Great news! I remember when code was my favorite toy, this book sounds like a lot of fun.

  • Julio Garcia says:

    Sound like the book could be a lot of fun, another Keith Peters great read, and self publishing seems indeed the way to go. One thing you should look into though, is that formatting code for an E-Book is not a trivial task. Professional E-Book typesetting may be a challenge and may increase your production costs. In any case, best of luck, I am already looking forward to it.

  • […] As mentioned previously, I have started working on self-publishing my Playing With Chaos book on the Amazon Kindle self publishing service. I quickly got the outline, first chapter, part of the second, some code and images done. Then last weekend I decided I better check into the whole publishing process in a bit more detail. I went through all the material on Amazon’s site, as well as several other tutorials. I even downloaded a free ebook on Kindle publishing and paid for another 99 cent book on the subject. I learned a lot, but none of it made me very happy to begin with. Here’s why: […]

  • fjckls says:

    Hi Keith, having read all your previous books can’t wait for this one to come out.
    How is it going with progress? If possible I would gladly pre-order your book to help you with expenses.