Noel Rappin Writes Here


Rails Test Prescriptions 2 Is Coming

Rails Test Prescriptions, mstjs, trddNoel Rappin2 Comments

I’m pleased and more than a little surprised to be announcing the existence of Rails Test Prescriptions 2, (which may not be the final title).

You have questions. Even if you don’t, I have answers.

Can you give the news in the style of a movie poster tag line?


Coming in 2014. It’s time to get your prescription… refilled.

Rails Test Prescriptions 2: The re-prescriptioning.

When did this happen?

Really, just last week. I got an email asking if I was interested (Spoiler Alert: I was.), and we went very quickly through to contract.

What will it cover?

It’s a little up in the air still, but broadly, we’ve got this:

  • Updates to the big tools. Rails 4, RSpec 3, minitest replacing TestUnit.
  • Changes to the ecosystem, so updates to a bunch of other tools, including FactoryGirl, Cucumber, Capybara
  • Some deprecations — there are some tools discussed that are basically not anymore.
  • New tools. I think the biggest class of tool not discussed in the original RTP is quick startup tools like Spork and Zeus. I’d like to cover continuous integration options, too, we’ll see if I can make that fit.

Over and above all of that, of course, is the fact that the discussion over good testing practice has changed. There’s a lot more talk about maintaining large test suites, writing faster tests, and using tests to drive better Rails application design. I’m planning to talk about that aspect of testing as well.

I am really open to feedback and ideas about what to include and what can be safely removed (any Rails performance testing fans in the audience?)


Good question. I’d bet at least spring for the first beta. Ask me again in a few weeks.

Are you insane?

I assume you are referring to the fact that I have other writing projects in process.

Yeah, that. Well?

I’ve got it under control.

Yeah, I’m gonna need more than that, writer guy

Okay, let’s take them one at a time.

Okay. Master Space and Time with JavaScript: Ember

Well, the nice folk at Ember central were nice enough to release Ember 1.0, making my plan considerably more concrete than it might otherwise be.

I’m currently working on the draft-complete release of the Ember book, which I expect to release this week. Code up to date with Ember 1.0 and Ember Data 1.0 beta. Info on the Ember inspector, and more stuff on components and promises in Ember routing. Maybe another goodie or two if I have time. That should take me roughly to 115 - 120 pages, a complete draft, and it will trigger a price increase. If I release the book this week, the price increase will come about 9/16. You can still buy Master Space and Time With JavaScript with the handy-dandy purchase link.

The Ember team has announced plans to do new point releases every six weeks. My expectation is that through the end of 2013, I’ll fix errors, and come back toward the end of the year to see if there is anything that needs updating or adding. Probably the same through at least the beginning of 2014.

Okay. What about Trust-Driven Development?

That’s obviously a little more problematic. But I’m really happy with the book, it’s fun to write, and I’m going to keep up with it.

The initial release will still come in September, hoping for this week, but that one looks optimistic. Next week is a better bet. That release also triggers a price increase. And of course, you can still buy Trust-Driven Development at the fabulous purchase link.

After that, I’m not sure. One thing about this book, though, is that it is kind of a nice palette cleaner to break up writing just about code all the time, so I’m actually looking forward to having that as a project during breaks in the Rails Test Prescription 2 process, such as technical reviews and so on.

So maybe I am insane after all.

Anyway, I’m very much looking forward to revisiting Rails Test Prescriptions, fixing all the things I got wrong last time, and making all new mistakes. Hope you like it.

All I Post These Days Is Status Updates

Self Publishing, mstjs, trddNoel RappinComment

Here’s where we are at the moment.

Master Space & Time With JavaScript: Ember

I think I may have finally gotten my head around the Ember release plans. My current understanding is that:

  • A 1.0 final release of core ember is imminent, possibly as soon as September 1.
  • There’s another major overhaul of Ember-data (the “jj-abrams” reboot branch), which will become the master branch sometime between now and the 35th of Octvember. In other words, who knows?

Which leaves me with the following plan:

  1. Once Ember 1.0 is released, I’ll start on a relatively minor revision of the book that will make sure it works with 1.0, allude to some new features, maybe talk about the Ember Inspector if I get ambitious.
  2. I actually don’t plan to add all that much new content, it’s already 108 pages, I doubt it will go above 130. (For reference, the Backbone book is 120, with longer code samples). I want to go through an authentication example. I may talk about components or more advanced view topics.
  3. Some of that is just going to wait until Ember-data gets sorted out, so I’m not rewriting the thing over and over.
  4. The 1.0-related release may be the one that triggers the price increase (based on length). We’ll see. But it’s coming.

You can buy Master Space and Time with JavaScript.

Trust-Driven Development

Work is proceeding on this a little faster. I think I have about 30 pages of text (it’s a little hard to tell because I have a lot of blank chapters adding pages).

I like what I have, but the organization is going to need work. Right now it’s really a set of interconnected essays about project topics (already written topics include points and velocity, user stories, iteration management, the introduction, and a couple of other topics.

The current plan is to start releasing actual text around WindyCityRails, September 12th. That triggers the price increase from $15 to $20, but I’ll probably soften the blow with a promotion over WindyCityRails.

If it’s not ready then, plan B is the same thing but over Ruby DCamp two weeks later.

You can buy Trust-Driven Development.

And another thing…

Weird as it may sound, this represents me trying to clear the decks because a new project has come up. It’s not official yet, and it’ll get its own blog post when it is.

More State of The Stuff, July 2013

mstjsNoel RappinComment

Ongoing update and stuff

I know, I haven’t been blogging much. I can always tell when I’m putting things off because the half-finished blog posts stack up.

First, Master Space and Time In JavaScript is still on sale, and for the moment it’s still $15. Somebody using the twitter handle @shakerdev just called it a “great fucking read for JS devs.” So, I’ve got that going for me.

The ongoing projects list looks like this:

Master Space and Time Book 4: Ember

Still caught in the tension between wanting — really wanting — to get this one done, and the fact that the Ember team keeps releasing cool new stuff and not going to a 1.0 final release.

I should mention, in the wake of some comments on line about Ember’s volatility and books, that no matter what else I wind up doing over the next few months, my plan is to continue to keep the Ember book current through at least Ember 1.0, and I hope somewhat beyond that.

My planned topic list hasn’t changed a ton:

  • More on views and handlebar helpers
  • Ember data details
  • Ember-testing details
  • The new async routing API — this will probably include a short section on promises, which may get promoted to book 1.
  • I’d like to deal with some real-world examples, at least briefly, of things like authentication
  • I also may switch from jasminerice to teaspoon as a test runner, which may also mean going back and retro-fitting earlier parts of the books.

Angular Update

Since I last blogged about this, I’ve taken one baby step towards an Angular book, namely getting a new branch up in the book’s code repo set with Angular. The goal is to create the basic admin console stuff similar to the Ember book example. If I feel like I can do that and explain it clearly, then I’ll start writing. I think the odds are at just over 50/50 that I’ll do it. If I do, it will probably go on sale as a beta in very early stages.

Project Book Update

I should probably put this higher, but it’ll get its own post in a week or two.

A while back, I casually mentioned on Twitter that I was thinking about writing about how to deal with projects. This met, I think it’s fair to say, with near-total indifference.

Nevertheless, I’m still doing it, because I want to write some of this stuff down. The book now has a title, a scratch cover, and about 15 pages written. Final length will probably be in the 120 page neighborhood, but who knows.

Full announcement, including the title, and cover and a way to be notified when it goes on sale, will come when I get to a) 25 pages and b) a coherent outline.

I’m very excited about this, I think it’s going to be good.

If you’ve ever worked on projects with people who are not you, this book will help you.


If you follow me on Twitter, you may have noticed that I was discussing book pricing with Jim Gay of Clean Ruby fame. This was in the context of a new Ember book from Giles Bokett, that is priced at $47.

It seems like Giles, at $47, and I, at $7, are both sub-optimal in terms of maximizing revenue from our Ember work. I generally err on the side of under-pricing my stuff though some combination of my own insecurity and also the idea that an inexpensive book is accessible to more people.

Still, there’s erring on the side of inexpensive, and then there’s not having confidence in the value of your work. The full set of Master Space and time With JavaScript is going to be about 125 - 150% the length of Rails Test Prescriptions for less than 2/3 of the price. (And yes, I know that page length isn’t really a marker for anything. Still…)

Which is a long winded way of saying that the price of MSTWJS will be going up, with the actual date being either a) the draft-complete version of the Ember book, b) the first beta release of the Ember book over 120 pages (currently at 94), or c) the on-sale date of a currently-mythical Angular book. Exact pricing still TBD, though I’m still open to argument. I’ll probably also add some kind of workaround for students and others for whom the price is a hardship — not sure what that will look like yet.


Buy the book, please: Master Space and Time In JavaScript.

State of The MSTWJS Union, June 2013

mstjsNoel RappinComment

Here is the state of the Master Space and Time With JavaScript Union as a I currently understand it.

First, you can, you know, buy the book. Please.

An update to the Ember book should be going out next Monday or so. It has about 10-15 page chapter walking through a routing example with outlets and nested routes and the like. That’s puts the Ember PDF at just over 90 pages (including the back matter and contents and stuff), which compares favorably with the lengths of the other three books (97, 97, and 120, I think).

I think there are still a few things missing from the Ember book.

  • More on views and handlebar helpers
  • Ember data details
  • Ember-testing details
  • Anything else the Ember team adds before 1.0 (async routing, for example)
  • I’d like to deal with some real-world examples, at least briefly, of things like authentication

This points to a final page count roughly in the range of the backbone book, about 120 pages or so. Actually, probably more. Sheesh.

What’s tricky about this is that ember-data and ember-testing are still not quite done enough to write about them without risking throwing everything out and starting over, so it’s hard to give a final schedule.

The other books are quiet at the moment, though the Backbone book could stand an edit.

Thinking Ahead

Meantime, there’s a slow but steady trickle of requests for a MSTWJS Book 5: Angular. (A five part trilogy would make me feel like Douglas Adams)…

I’m genuinely not sure if I’m going to do this. The considerations are:

Opportunity. There’s clearly some space here for a book that really explains Angular. According to a Twitter poll — which I’m sure is totally reliable — the overwhelming majority of existing MSTWJS customers would expect to pay for a Book 5. This actually goes a long way toward making me think this is worth my time. Writing tech books is kind of a hobby for me, but I’d still like to feel that I can make a little bit of money from them.

On the other hand, I’ve been working on this book for two years now. That’s a long time in Internet years, and doing an Angular version probably means another three to six months of work. There are other things I want to write, and it wouldn’t kill me to blog regularly again. (Actually, that implies that I once blogged regularly, which is not really true.) I really want to do this project book, and I’m starting to feel like I have new things to say about testing.

Anyway, right now I’m thinking that I’ll at least play with Angular a bit to see if I have any affinity for the tool at all. If I hate working with it, I’m not writing about it. If it passes that hurdle, then we’ll see.

If I do it, the likely scenario would be — don’t hold me to this, I’m just thinking out loud: * Priced at $7 or $9 based on length * Existing 4 book bundle owners would get a discount, possibly a limited time discount depending on what I can do via DPD. * At that point, new customers would get a five book bundle. I might raise all prices at that point — the hypothetical five book bundle would be nearly 600 pages. Not sure what that pricing looks like yet. $9 per book with a $25 bundle is one possibility.

Please let me know if you have thoughts about this — my perception of people’s willingness to buy an Angular book in this series is a major factor in whether I do it.

And, oh yeah, buy the book.


Status Update

Self Publishing, mstjs, self promotionNoel RappinComment

It’s been well over a month since the last official update to Master Space and Time with JavaScript, and since I was hoping to get updates out more-or-less weekly, it’s probably a good idea to check in and let you know what’s going on. (Could be worse, though, I’m still hoping to post my top 10 books I read list. From 2011.)

All of the MSTWJS customers out there have been either very patient in waiting for the next update, or you are completely disengaged. Personally, I’m choosing to assume patient.

I am continuing to work on the book, it’s just slowed down quite a bit. The next update will most likely be sometime after RailsConf — ideally sometime in the week or so following. So by, say, May 10th. I post this date publicly to increase the chance that I’ll actually hit it.

There are a few reasons why the book’s progress has slowed.

To some extent, it’s a deliberate slowdown so I don’t have to rewrite the thing a dozen times. Yes, Ember is in an API freeze, but they are still adding new things that preserve compatibility, and Ember-data is decidedly not in an API freeze. Just in the last week or so, integration testing tools are starting to emerge — see this discussion for details. Honestly, the fact that I had to throw my hands up over integration testing in the last update was very disappointing, and I’d very much like to get that working in the example.

There’s also been some fumbling about what I want to cover in the rest of the book and how I want to get there. This one, I think I’m getting a handle on.

I also got busy. For example, I’ve been starting this weekly sort-of-screecast series for Table XI called XI to eye. I’ve never done anything like it, but I’m pleased with how this is going. There are five so far, you can see them all at Please do check them out.

I’m also doing two sessions at RailsConf — a normal session comparing rich client MVC with the 37Signals Basecamp approach and an intro track session on testing complex systems. More on those next week, but I’m excited for both of them.

There’s also been some laziness, and some lack of momentum caused by the combination of the previous points.

Still, hoping that this will move a little more rapidly in May — we’re now coming on the two-year anniversary of me starting the project (though I suppose I’d be done if I hadn’t decided to pick up Ember as a topic), and I’m certainly ready to move on. (I have some idea what my upcoming writing projects will be, just not sure which one I want to tackle next.

Thanks for your patience, if you are enjoying the book more will be coming — there will also be another errata catch up on the first three books. Please do help spread the word, or maybe buy it yourself.

Master Space And Time Status Update

Self Publishing, mstjsNoel RappinComment

Here’s a quick status update on Master Space and Time With JavaScript, book 3…

Short version: expect an early beta of about 1/3 of the book to be out in about a week.

Longer version:

Work is proceeding steadily, the current draft of just hit 30 pages toward a target of around 90, though about 10 of that is the same intro and outro that the other books have, so it’s more like 20 pages toward a target of 80.

The structure of Book 3 is one chapter on replacing the existing app homepage with a very simple Backbone clone, then another chapter building a different page using Backbone that has more events and more complexity, then a third chapter talking about communication between Backbone and the server, and anything else that comes up. The exact division between the second and third chapters may change.

I will release the first beta when the first chapter is draft complete — this will be rougher than the other books because it hasn’t gone through rounds of review and editing, but I like how it’s going. I also need to clear through reported errata on the first two books, and probably clean up the landing page in expectation of doing another marketing push.

Thanks for being patient and for your great feedback.

Oh, and you can still buy it!

How's it Going? MSTWJS Edition

Self Publishing, mstjs, self promotionNoel RappinComment

And now for a more inside-baseball post about how the self-publishing aspects of Master Space and Time With JavaScript are going. Did you know you can buy it?

Short answer: Pretty well, though I could always have done better. Still unclear how this will work over the long haul.

At this point, the book has been on sale for 10 days, plus the pre-sale to people who were on the mailing list. It’s clear that the initial burst of traffic from incoming links is slowing down, and I’m now entering the longer struggle to get people interested — not completely sure how to do that.

Anyway, a few disconnected points about the process so far

One of the big things I miss about a larger publisher is the marketing reach. That said, there’s something really nice about how people feel a little bit of ownership concerning self-published projects that they like. I’ve gotten a couple of very nice copy-edit runs, for example.

I’ve generally been lucky in reviews (notable exception: the two-star review of RTP on Amazon that I check out whenever my Impostor’s Syndrome feels insufficiently pronounced…), and so far, the people who have commented on the books where I can see them have been positive.

I can be a little transparent with numbers. As I type this, traffic is still about double the level that I had generated in the past on days that I posted to the blog, and much, much higher than the ambient level of traffic when I hadn’t been posting.

Over the course of the ten days, about one in six people that have hit the landing page at /mstwjs and aliases convert to either the free version or one of the paid versions. Low day was 12%, high day was just under 23%. There doesn’t seem to be a consistent trend between traffic and conversion rate.

So that’s about one in six doing anything, of those that do choose, about one in six or so actually bite on one of the paid versions. So that’s a paid conversion rate in the 2 - 3% range. That rate seems to be slightly negatively correlated with traffic, which is actually in line with what I would expect.

As for the pricing strategy, which I thought was so clever… So far, there have only been a very few people buying book 2 at the $7 level — most purchases have been of the whole book at $15. I’m not planning on changing the pricing (beyond my already-stated plan to raise the $15 when Book 3 gets near-final). I want to see how this looks when there are more individual books for sale. But there’s a good chance this means that I outsmarted myself, and probably could have priced a little higher.

So far, as best as I can tell, under 3% of people who originally downloaded the free version came back to upgrade. That seems very low, but it might be higher — the way I’m counting this, if somebody gave me a bogus email for their freebie, I wouldn’t track it as an upgrade. Also, I assume this number goes up a touch as people read the book and as upgrade reminders go out. Still, as it stands, it’s not a great data point for the “give away free stuff to increase sales” school of internet marketing.

Over the course of the ten days, the number one referrer, by far, was Peter Cooper’s JavaScript Weekly email newsletter. It’s the biggest by about a factor of three over the next highest measurable referrer. Next up was Twitter, and I think the highest link out of those came from JavaScript daily, and I think the second one was from my feed. It’s really hard to track those for sure, though. Third was Google Reader, though I think that was mostly blog posts and not links to the landing page. Fourth was Reddit — my post there didn’t get much traffic, and fifth was the Ruby5 podcast and show notes. Rounding out the referrals so far is Mike Gunderloy’s Fresh Cup links, and then we also get some noise with internal referrals and things like Pocket, and the Ruby Rogues link, which just came out.

Another point of comparison is that MSTWJS sales are about 150% + of RTP sales over the first ten days. That’s less impressive than it sounds, I really struggled to get traction with RTP after the initial burst. (That’s the paid number for MSTWJS, and it includes the pre-sale to the list). RTP had a free section as well, and I don’t have any stats on how often that was downloaded, but since it was just a link and not a shopping cart, I think it was pretty high.

That’s where we are — I hope that those of you that bought or downloaded the book are enjoying it, and if you are hoping to do your own self-publishing project, I hope this information is helpful.

Oh, and the book is still on sale.

The Origin of Master Space and Time With JavaScript

Self Publishing, mstjs, self promotionNoel RappinComment

I have a new book, Master Space and Time With JavaSript. You can buy it.

Here’s the secret origin.

This all started over a year ago. Rails Test Prescriptions had been complete for a few months, and I was getting a little antsy to take on a new project.

But what? I wanted it to be a project where I would learn something, and I wanted it to be something where I had a particular perspective to offer.

A couple of recent experiences pushed me toward view-level coding in general, and JavaScript in particular. About then, for the first time in a while, I worked on a project that had a reasonably serious JavaScript front-end on a team small enough that I was contributing some of the JavaScript.

It quickly became clear to me that JavaScript coding had changed dramatically, not just from my first pass at it (warning clients away from it circa 2000), or my second pass (avoiding it with RJS circa 2008). The tools were better, the idioms had changed, and the expectation was that future web applications would need to handle this stuff very well.

I was also working with a new Obtiva apprentice, who wanted to build a very JavaScript-heavy site, but didn’t really know much JavaScript. In searching for books to point him to, it seemed to me like there was an underserved part of the market, not for total beginners, not a description of a particular library, not a pronouncement from On High about The Right Way To Do Things, but a practical guide to writing and testing modern JavaScript to do cool stuff.

Which is what I set about to write. My original proposal for this book may well be one of the best pages of text I’ve ever written.

And yadda, yadda, yadda, here we are.

I knew I wanted the book to build up on a single web application example — I’ve always liked that style, even though it can be a pain in the neck to structure. I also knew that I wanted to have a lot of testing in the book. Not only is writing about testing in JavaScript something that seems pretty needed, it also felt like a perspective where I actually might have useful things to say. Plus, I had used the largely-test-first style of writing before (in the Wrox book), which I’m sure was appreciated by all three of the people who bought it. I thought I could do it again.

The idea of taking an application with no JavaScript and adding JavaScript features seemed like a good hook. I’d used the Time Travel Adventures travel agency before (for my testing legacy code workshop), and the idea of a time-traveling client who was confused about what modern web sites needed seemed like a suitably silly hook. (In the first draft, the client was named Emmett Brown, but I was guided away from using that name directly, hence the client becomes the mysterious Doctor What.)

And I was off…

Here’s what you get in the books.

Book 1 is largely concerned with a particular simple-seeming request: add a show/hide toggle link to each trip on the home page. Although this is simple, it actually winds up touching a fair amount of jQuery — using selectors to find elements, binding events, and manipulating element pieces.

We build up this toggle thing in a few stages. First is a quick pass writing a simple version of the toggle functionality test-first. The goal here is a sense of what a test-driven process looks like in JavaScript, plus the basics of how Jasmine and jQuery can be brought to bear to write the feature. It’s basically the book equivalent of “fast to green”. We solve the problem with the understanding that we’ll clean up the details later.

Then we go back with two more chapters that go more in-depth on first Jasmine, then jQuery. In these chapters, we don’t add new features as much as describe the library features that supported what we did and explore related functionality.

The final chapter of Part 1 covers the JavaScript object model and why it is confusing if you come to JavaScript from a more traditional Object-Oriented language. By the end of it, we’ve used the module pattern to build the most over-designed show/hide toggle ever. I’ve had some experience doing workshops based on the material in this chapter, and it seems like even people who have been doing JavaScript for a while get something new out of it.

And that’s Book 1. It’s available for the low, low price of zero dollars and zero cents. Worth every penny.

Book 2 is mostly about apply and extend. The first chapter is about building up an widget that combines an autocomplete text input with a list of currently chosen items. Test-first, of course. The we throw some Ajax in the mix, extending our already gold-plated toggler with the ability to get data from a server. This also gives us an excuse to talk about Jasmine spies. Finally, we build up a rating widget, with the clickable stars and a histogram and stuff, which lets us talk about JSON and Mustache. There’s also a small, slightly out of date bit on the Chrome developer tools. I’ll catch up on that at some point.

Book 2 is a mere $7.

Or you can get Books 1 & 2, Plus books 3 & 4 when they come out for $15. That $15 is a temporary price, and will go up when Book 3 gets closer to completion.

Book 3 is going to be about Backbone. I know the structure of most of it — first, we’ll recreate the front page using a Backbone structure. Next, we’ll build a buy page that allows you to make several calculations about differing trip purchase options on the client. Not sure about the last part, it will definitely include communicating back to the server, probably something else.

Book 3 is going to start appearing on the site in a couple of weeks, and will probably be draft complete by the end of September.

Book 4 will cover Ember.js. I’m not sure yet what we’ll build, though I want it to be a new part of the site, and not a recreation of the same things we do in Backbone. I’m hoping that Book 4 will be out by the end of 2012.

Oh — the title. I had a list of two word titles that were like POWERWORD JavaScript, but all of them were either taken, sounded ridiculously stentorian to me, or both. The original proposal titles were “Getting Things Done in JavaScript”, which nobody liked, or “JavaScript for People who Hate JavaScript”, which nobody liked (see the pattern).

I had Master Space and Time with JavaScript on my list as kind of a joke — a reference to the Time Travel conceit in the book. Plus I liked that it sounded like a pulp adventure novel, and would lend itself to a cover easily. I know it’s not the, like, SEO favorite title, but I’m hoping that people won’t forget it once they hear it.

The cover, by the way, is my own design, and I like it considerably more than many of the other things I’ve designed. (I’m also pretty happy with the PDF layout…) I think the cover particularly works well at thumbnail size, so you can see the difference between the individual books easily.

That’s the story. Hope you like it. Buy it!, or tell all your friends (Twitter hashtag #mstwjs).


Master Space And Time Release Plan

Self Publishing, mstjsNoel RappinComment

There is a plan.

It goes like this:

Master Space and Time With JavaScript will be split into four parts.

Part one and part two will be available sometime in July. I’d say July 1st, but I’ll still be in Scotland. It’d be sooner, but there are still logistics to be managed around the actual layout of the book and getting the payment gateway in order. Plus, I need to actually finish the text.

Part one is an introduction to Jasmine, jQuery, and the JavaScript object model. It will be available for free.

Part two will be more advanced jQuery, Jasmine, and JavaScript examples. It will be available for, most likely, $7.

Each part will be on the order of 50 - 75 PDF pages. The exact split between the two parts will depend on the final page count of the chapters.

You will also have the option to pre-purchase the entire book — that’s an immediate download of parts one and two, and an eventual update with parts three and four. That bundle will most likely be $15. I’m not sure yet how long that option will remain available.

Part three, will cover Backbone.js. It will come out something like four to six weeks after parts one and two. Part three will also be $7.

Part four, which will cover Ember.js, will come out some time in the future, same deal.

There are two reasons why the Ember.js part might take a few months. One is that I’m still kind of waiting for Ember.js to settle.

But the main reason is that I plan on doing other things.

More mini-books, in the 30-75 page range, for $5 to $10 each. I’m going to do at least one, maybe two, before the Ember.js part. (Yes, I’ll say what they are. Eventually).

And that’s the real plan: an outlet for me to release these mini-books on a regular basis. To write these ideas that I have that aren’t quite long enough for full books.

I’m excited about this. I have a few topics I’ve wanted to write about for a long time, and this is way for me to get these out to people who I think will find them useful, interesting, and fun.

A couple of other logistical things:

  • In case it’s not clear, all releases will be digital with PDF, ePub, Mobi, maybe HTML. iBooks Author is a possibility, but probably not in the immediate future.
  • I would update previous books to correct errors and typos and that kind of thing.
  • I’d like to have some way to offer something like a subscription. I need to find out what the payment tool I’ll be using makes possible.
  • I’ll probably have some sort of umbrella name for the series, but I don’t know what it will be yet.

I think this is a good plan. I hope you agree. I’d love to hear your thoughts, and if you want to get an email when the first two parts are available, please fill out the interest form

Master Space And Time With JavaScript Update: The First Couple of Chapters

mstjsNoel RappinComment

It’s not much of an exaggeration to say that I’ve been writing the same two or three chapters for six months. I think — I hope — this is the last time.

This is a more or less weekly update on the manuscript currently known as Master Space & Time in JavaScript. Today, the update is about the first few chapters and how they change over time. These chapters cover a lot of ground, and getting the order and beats right has been a struggle. But I think I’ve got a good handle on it now.

(If all you want is a pure update: I’m making progress. The biggest factor in when the book actually goes on sale is how much I decide to have completed before I sell it. But I think we’re still looking at a few weeks out.)

The problem with the first couple chapters is that there are a lot of topics to cover right at the beginning. The first part of the book introduces jQuery, but I also want to introduce testing as a practice, so Jasmine comes in immediately as well. I want to use the examples in the book to model a good test-first practice (for the two or three of you that are familiar with my Wrox book, you know that I tried something similar there).

However well intentioned my plan to cover testing is, the fact is that for a reader unfamiliar with both, simultaneous exposure to Jasmine and jQuery has a lot of potential to be confusing.

In my first draft, the reader was presented with a suite of three or four Jasmine tests, which were fully explained, then with the jQuery code. The example is super-simple — just making a detail show and hide based on a user click. That’s on purpose, so nobody gets bogged down in the details of the example. Even though it’s simple, it does touch on a lot of basic jQuery features, which were explained in some detail, while also referring back to the Jasmine.

Some early reviewers found the back and forth confusing, so I tried a few different ways to clean it up:

  • I really like starting books with quick demos that show off things that will be fully explained later. So I added one that covered the JavaScript console. More on that in a moment.
  • I added a lot of text explaining exactly where the reader was, why we were talking the thing we were talking about and so on. A lot of this was necessary and stuck around, though at one point I wound up with a two-page chapter introduction that was — accurately — described as “apologetic”.

Eventually, though, I tried to separate the chapters, presenting the jQuery code first and then the Jasmine tests after. On the plus side, separating the two led me to write much better explanations of each library. On the down side, the order just felt really wrong to me, it wasn’t really the way I wanted the book to go.

As I tried to bring the material together for the new version, I came up with an answer that I think keeps all the draft material I like, and scraps the stuff I don’t. I mentioned that I really like quick-march introductions for my books. It finally occurred to me that the small example actually works as a quick introduction. So the plan is to work through that example in a kind of strict test-first way, showing the rhythm of a BDD process without a lot of library detail. Then go back and describe Jasmine in more detail, then jQuery in more detail.

Which makes this the current table of contents:

  • Introduction. Mostly logistics, explanation of what’s there and so on.
  • First Look: The quick walk through Jasmine and jQuery.
  • Jasmine in more detail.
  • jQuery in more detail — at least the basic selector and element manipulation parts.
  • JavaScript functions and objects. How they work. We take the simple code from the first example and apply different JavaScript module and class patterns to it. I like this chapter.
  • Developer tools, the console and the WebKit package
  • Pulling the first few chapters together on a more complex example — a multi-select autocomplete widget.
  • Ajax. How to do it and how to test it.
  • JSON. This is an Amazon-style rating widget, so pulling in everything so far plus Ajax, plus JSON.
  • Backbone. Probably 2-3 chapters here, covering Underscore, and Mustache. This is the point where we get to things that haven’t been written yet, though I do have an outline.
  • Depending on how ambitious I feel at this point, a similar treatment of Ember.js is possible.

The initial release is most likely everything up to the JSON chapter, thought it’s possible I may start putting it out there once I finish reworking the autocomplete widget chapter.

If this sounds interesting to you, let me know by signing up. There’s still time to suggest other tools you want covered. Or leave a note in the comments here.

Self-Publishing Workflow Update

Self Publishing, mstjsNoel RappinComment

Next up on the Master Space and Time With JavaScript status report is the workflow that takes my words and turns them into a PDF. And an HTML file. And an ePub. And don’t forget Kindle.

As you can imagine, this is something of a minefield, although there are a lot more tools available than there were three years ago when I did this the last time — here’s an overview of the process I used then. That article talks about the process that I used on Rails Test Prescriptions for as long as it was self-published.

Things have gotten more complicated. Most obviously, there are more devices and formats to support. The Kindle’s mobi format and ePub are different, and every ePub device has its own quirks. On the plus side, there are a lot more tools and libraries available than there were, though figuring out what they all do is a challenge in itself. Plus, a lot of the existing tools produce documents that are, well, kind of dull-looking, especially noticeable in the PDF versions. (If you are a self-publishing author, I don’t mean you, your stuff looks great. Those other people, though… can you believe them?)

Over the last few years, I’ve gotten addicted to being able to sort of see what the text looks like all laid out fancy and the like. So it was important to me to get at least the semblance of a tool chain in place before I started rewriting in earnest, not least because I needed to figure out what format the text was going to be.

Here’s what I’ve got. It starts with Markdown, because Markdown is pretty simple, I’ve been using it for years, and there are like a jillion editors that support it. Because I’m using Markdown, I’m also experimenting with writing the book in a more writerly editor like Byword, rather than a programmer editor like Sublime. In theory, this will make the book less… I don’t know, less programmerish, or less sublime? Dunno, but right now, I’m enjoying the change of scenery.

Then it starts to get complicated. There are multiple implementations of Markdown or Markdown-like libraries, and they all are subtly different. Right now, I’m using Multi-Markdown, since it has footnotes and cross-references, though there’s some possibility I’d switch at some point in the future. (I love footnotes, and I’d add one here, but I don’t think this blog engine uses a version of Markdown with footnotes.)

Markdown’s weakness is that it’s hard to specify custom styles or HTML classes. I’m working around that by running my Markdown text through a pre-processor where I can put in some custom directives. I can, for example, write:

:title A Sidebar
The sidebar content goes here

The pre-processor catches that, and converts the code into some specially styled HTML. (Yes, I’ll be open-sourcing the tool at some point in the future.)

I’ve also added something that I’ve wanted for a long time, namely the ability to insert code from a file at an arbitrary branch in a git repository, meaning that I can show code from multiple successive versions of the same file just by having them in different git branches. Meaning I can distribute the sample code in a git repository and have it not look too awkward.

I also have the ability to post-process Markdown’s HTML, which I think I’m eventually going to need to reconcile the rest of the tools.

Once I have the converted HTML, I need to generate e-book files. For PDF, I’m going back to using PrinceXML. There’s a lot of things I like about this tool. For one, it has a lot of the features that you would normally associate with actual books, like section numbering, footnotes, cross references, and page headers and footers. I think it produces nice-looking files, and its controllable with CSS, a technology that I (mostly) understand, so it’s easy and fun to tinker with.

I didn’t have any existing tools for ePub or Mobi, so I looked at somebody who I thought was creating pretty nice files, specifically Avdi Grimm, who did a pretty great job with the Objects on Rails ebooks. Avdi created his own tool called OrgPress, and for ePub and Mobi, he uses the command line interface to Calibre. Even though OrgPress uses Emacs Org Mode, Make, and Awk — three tools that, to put it mildly, I feel no particular pull to tinker in — I was able to take advantage of Avdi’s hard-fought war with Calibre to get a set of command line flags that basically work, though I’m going to have to tweak them a bit before they are salable. I’m also looking at Rpub, since it’s in Ruby.

One nice side effect of all these tools is that it’s easy for me to have an almost all iPad workflow — I turn on watchr on the laptop, write using Byword on the iPad, and when Dropbox syncs the file, the ebooks are all updated, and I can view them on the iPad via Dropbox. Not bad.

I know this isn’t done yet. For one thing, I suspect that Multimarkdown and PrinceXML are going to disagree on the format for a footnote, and I’m probably going to have to referee. Later note: it’s worse then that… Multimarkdown’s footnote format actually crashes the Mac Adobe and Nook ePub readers, though that seems to be a bug on their end, and it does work in iBooks.

I’m eventually going to need custom styles for each format — the sidebar CSS that looks great in PDF looks awful in iBooks. And I’ll need a cover.

And, you know, content.

Master Space And Time With JavaScript Status 5-08

JavaScript, mstjsNoel RappinComment

Now that the new book is public, I’m going to start doing more frequent status updates. It’s going to be weird for me, after keeping the project under wraps for so long, but I’m sure we will all get by.

When the book, shall we say, reverted back to me, I had two immediate questions: what to write, and how to deliver it to a (hopefully) desiring public. Let’s talk about the content first, though in practice, I needed to make sure I had a tool chain I liked before proceeding.

At peak length, the manuscript was about 150 PDF pages, give or take, comprising something like 60% of my outline. Great! Ready to start selling. Except for a few things:

  • Because the last few months consisted of a few different writing experiments on different parts of the book, the pages that I have aren’t consistent.
  • Some of the text was started but not finished once review became more important… There is a chapter or two that I haven’t even read in months.
  • Plus, life marches on. Ember.js wasn’t even a thing when I started, now I’m increasingly feeling like I need to cover it.
  • The existing code is in an XML-esque format, and my preferred toolchain starts with Markdown.

Those points are all annoyances. The real problem is harder to articulate. Maybe the best way to put it is that the review process made me kind of cautious when writing, and that the book needs to be bolder and more sure of itself in order to succeed.

So the content part of the last week has involved writing a new, short introduction, I think I’ll probably revisit that once I have more of the rest of the book in place. I’ve also started transporting the first real chapter, but it’s more of a re-imagining than a copy and paste.

The way the book is set up, it uses the Time Travel Travel Agency example I’ve used in a couple of workshops — hence, the name — and you are contacted by a possibly time-traveling client who asks you to continually make JavaScript changes to his application. It’s a little silly, but I like it, and it keeps some focus on writing JavaScript in a real, if smallish, application. I’m refocusing the content on teaching good BDD practices, part of what I’m doing right now is trying to balance learning BDD with learning the JavaScript.

And that’s where I am. I’ll keep updating status regularly. If this interests you, remember to sign up.