Sunday, November 25, 2012

How I Wrote My eBook

In a "How I Work" interview on, Tim Ferriss recommends the OS X app Scrivener:

Scrivener, the word processor I've used for the last two books. Unlike Word, it doesn't crash every five minutes, and I can look at multiple docs at once in the same window. [It's] minimalist and great.

In my opinion, Scrivener's certainly better than Word, but what isn't? I haven't been naïve enough about computers to go anywhere near Microsoft Office for at least a decade. I can't call Scrivener a word processor, either, and I especially can't agree with "minimalist and great." I recommend buying Scrivener anyway, though.

I'd describe Scrivener as writing software, which includes a word processor, an outliner, and an innovative UI mode which models a whole category of time-honored writing workflows based around index cards and corkboards. I believe it's actually designed for screenwriters, but modified to be useful for all writers generally, although I could be wrong about that.

That's why I can't agree with "minimalist" or "word processor." I believe "great" would be true if "minimalist" was true. As it is, I experience all kinds of minor UI bugs and excessively assertive auto-formatting whenever I use Scrivener, and consequently I can only call it good.

However, I really like the workflow which Scrivener models -- I think that core part of it really is great -- so I created a simple copy of it with Ruby and Markdown. I threw all the notes in one place and threw all the actual finished writing in files which looked like this:

All those files lived in their own directory. I churned out a simple HTML file from that:

I think this kicks Scrivener's ass in the "minimalist" department, but I can't call this method "great" either. Once the writing was done, I copy/pasted the HTML output into Pages and then did a lot of formatting by hand. It took a while.

But minimalist writing tools rock. I want tools that get everything but content out of my way. Style is great, but I believe my products live or die based on how well-written they are. So I believe I'm much more likely to add a few layers of sophistication and CSS to this workflow than I am to return to Scrivener.

If you're really serious about writing, though, I recommend buying Scrivener anyway. I've written many screenplays, and the one I wrote with Scrivener was easily the best. The implementation is flawed, but the ideas are great. I see Scrivener as a very good set of training wheels, and I plan to continue developing this minimalist approach of mine into a fully-fledged mountain bike. I'm hoping that the only adjustment I'll have to make for screenplays is to use Fountain instead of Markdown.

"The implementation is flawed, but the ideas are great" is also one of the key things I say about Rails in my new book. I'm planning to blog about that soon.

Tuesday, November 20, 2012

Travelling And Eating Right: An Unusual Solution

I eat a very restricted range of foods: basically just vegetables, beans, and fruit. I say "basically" because no starchy vegetables are allowed. Because of this, travel is usually a pain in the ass for me. Often the best an airport restaurant can do to satisfy my rules is an anemic salad for $14, and I have to pick the bits of bacon and cheese out by hand before I can eat it.

I am not a patient person when it comes to food. Typically when I encountered this problem, I caved in and ordered fries, burgers, whatever I could get, and just figured I'd get back to eating right when I got home. But getting into an old habit of eating a familiar kind of food makes it hard to switch back to eating right, so in practice, every time I went to a conference or saw my family on a holiday I would be breaking my nutritional rules not only during the trip, but also for weeks or even months afterwards.

It was easy to convince my family to make allowances for my health, of course, and a few times I tried renting a house with a kitchen when I went to a tech conference, instead of eating hotel food. But the airplanes and airports always killed whatever progress these other efforts brought me.

However, I recently figured out a solution, and I got to test it today. I was in airports and airplanes from 8am to 9pm, owing to some travel snafus. Since the airports and airplanes had almost nothing to offer me which I could eat, I ate almost nothing.

It worked out fine. I ate a few bananas, a few grapes, and a few pieces of pineapple and melon. I also made a small breakfast at home of chickpeas, kale, and mushrooms.

Before I began eating the way I now eat, I could not last more than a few hours without eating. I got shaky, cranky, and queasy (coincidentally the names of some of Snow White's lesser-known dwarven friends). None of that happened today. In fact, most of the time I forgot all about feeling hungry.

I wasn't surprised by this result. In 2010 I did a little experiment where I did deliberate fasts, not eating anything except water for a day or two at a stretch. I did this because I had read that my style of eating promotes remarkably stable blood sugar, and that many of the symptoms people identify with hunger -- shakiness, crankiness, and queasiness, for example -- are not actually due to hunger at all, but to fluctuations in the levels of blood sugar, naturally-occurring toxic chemicals found in meat, and/or man-made toxic chemicals found in processed foods. My nutritional rules ban meat and processed foods.

In other words, if you eat the way I eat, you don't have to eat every day, and it's not a big deal. I did my short series of experimental fasts because after I read about this, I was very curious to discover first-hand if this was true. It was, and is.

This simple tactic of just fasting my way through the airplanes and airports thing means I can go to tech conferences again. I stopped going to tech conferences because I burned out on it -- I delivered at least 15 presentations at user groups and conferences in 2008, and exhausted myself -- but the reason I never started back up again was this dietary problem.

In 2011 I went off my nutritional regimen and gained a staggering amount of weight. I've gotten back on track with it, and lost around 20 or 30 pounds since my worst moment in 2011, but the point is that my health was more important to me, and tech confs were not worth the risk.

So, I'm pretty stoked about that, and may start going to conferences again.

Monday, November 19, 2012

BritRuby Kerfuffle: Silly Even By Ruby Standards

BritRuby (mild) critic Josh Susser: I don't think adding diversity at the end works. You have to start with it as one of your goals. Who wants to be the token female?

BritRuby organizer Sean Handley: Adding a token minority speaker is offensive to that speaker, it says "You're here because you tick a box - not because you're skilled."

Note how the "critic" who allegedly destroyed the conference expressed the exact same idea as one of the people who put it together. They were saying the same thing, for one small, tiny moment, which in real life might have led to some kind of common ground, but there was a whole lot of freaking the fuck out, and there was no searching for common ground.

Rubyists need to get better at having reasonable conversations.

Avdi Grimm wrote a blog post about this. I couldn't bring myself to read it. Instead, I counted the words using copy/paste and vim: 2,995.

That's a lot of words.

(I was able to read this post by Elisabeth Hendrickson.)

I sat this thing out, uninstalled my OS X and iOS Twitter clients, and even though I occasionally logged into the web client (making sure to log back out again, because anything which makes Twitter harder to use is good for my productivity), I basically wrote an entire ebook on Ruby on Rails and its deviations from classical OO theory (both its misguided deviations and its inspired ones) in the ensuing free time.

Now this is somewhat an exaggeration, because I had the idea for the book on Wednesday, and I already had an outline when I started writing it Thursday night, and there were several shots of espresso involved, but it's not much of an exaggeration to say that I wrote an entire ebook with the energy I saved by not participating in a discussion about how some mild criticism completely destroyed a 500-person conference.

OK, actually, that is a big exaggeration, but still. What I'm saying here is I got a lot done without paying attention to the drama, and I don't think this tempest in a teapot means anything.

Rubyists need to get better at choosing their battles.

Wednesday, November 14, 2012

Hollywood Delivers Perfectly Accurate Representation Of Startup Life

Like most people whose work stems from the Internet, my parents wonder what it is I actually do for a living. Wonder no more:

This helpful documentary contains no exaggerations whatsoever.

Sunday, November 11, 2012

Inevitable Convergence Of Porn And Reality TV

Playboy TV is casting for a brand new comedy game show called "The Man" We are currently looking for attractive males and females ages 21-30 who are comfortable with on camera nudity and possible sexual interactions. Men will be competing to prove to women that they have more "game" than the other contestants. Pay for women is $500-$700 for the day. There is the possibility of females being used on more than one episode. Pay for males ranges anywhere from $300-$600 depending on which round they are eliminated.
Compare and contrast: PG Porn, porn-style short films without the sex; a reality show about porn stars raising children; what appears to a be "Loveline meets the Internet!" show called Love In The Time Of Robots; and an actual person having sex with an actual robot (NSFW).

The above was posted in July 2012. The show appears to be live.

I'm actually very curious what effect the widespread availability of Internet porn will have on film in general. In the 1920s, people were making porn; by the 1950s, censorship had completely crushed porn. When it came back in the 1960s and especially the 1970s, it was part of an overall sea change in cultural attitudes around sex, influenced to no small degree by the sudden availability of chemical birth control.

At that time, almost nothing except nudity and actual sex differentiated porn films and "real" films. Last Tango In Paris could be categorized as either one with equal validity. Today, porn actors are not "real" actors. Porn films are filmed differently, distributed differently, and only a few filmmakers (either "real" or otherwise) have taken it upon themselves to regard porn as cinema.

One notable exception comes in Mike Judge's Extract, where a paranoid husband allows a friend to persuade him that the best way to find out if his wife wants to cheat on him is by dangling temptation in front of her:

By incorporating a visual style reminiscent of porn, Judge implicitly acknowledges here that pornographic film is film. This fairly obvious fact is very conspicuous by its absence in the field of film criticism. I strongly suspect that failing to regard pornographic film as a type of film constitutes some type of ghettoization of sex. It's especially strange when you contrast it with how French film treats sex.

The exploitation aspects of Playboy's The Man series are obvious, but what's interesting is that its pornographic aspects make it nominally less respectable in American culture than its "legitimate" cousin in "real" reality TV, Jersey Shore, which is well-known for an episode where a girl gets punched in the face. Neither show is awesome in my opinion, but it's strange to me which one is labelled more respectable (albeit by a very thin margin).

It's possible that this hierarchy of respectability, where violence is acceptable but sex is not, operates like a semiotic poison. I also find it very interesting that the two periods most associated with increased availability of porn in the United States -- the 1920s and the late 60s/early 70s -- also saw substantial increases in female political power. I really doubt it's any kind of coincidence; consider, for example, that Islamic and Christian fundamentalists, who both seek to restrain female sexual expression in their respective cultures, are also united in their antagonism not only to female political power, but also to men who act feminine. Robert Anton Wilson wrote an excellent book about this (and originally wrote it for Playboy, in fact).

However, the issues are so far from decided that you could build an entire academic career on arguments for either side, so I'm not going to tackle that here. But insofar as my blog has any theme at all, Internet entertainment which may in some way reshape or alter society has got to qualify, so I think this is an interesting trend. Porn disappeared completely in the 1950s and is now everywhere. It's highly unlikely that this will not either exert some transformative effect on society, or reveal some transformative dynamic already in operation.

Saturday, November 10, 2012

Daddy, Somebody Hacked Teddy Ruxpin!

When I was a small child, my family went to DisneyWorld. For some insane reason, at DisneyWorld, they set up plastic trees instead of real trees, and even beyond that, the plastic trees had plastic birds on them. So I saw a bird in a tree, and I got excited to be so close to a bird without it flying away, but then when it continued not to move, I thought it was dead.

But then I noticed the tree was plastic, and the bird was plastic too, and I started wondering what was wrong with people. Frankly, I'm still wondering.

ToyTalk, a "family entertainment" startup that makes a "smart," internet-connected, artificially-intelligent teddy bear, has secured a total of $16M million in institutional funding. The company was founded by former Pixar CTO Oren Jacob, and ToyTalk CTO Martin Reddy previously worked at the organization that built virtual personal assistant Siri.

The sheer opportunity for clever children and especially teenagers to create inappropriate hacks here is just extraordinary. You could wire it up to a dildo, you could make it talk in a creepy voice and tell small children tales of murder, and that's without even really getting creative. I love Pixar, and I'm sure in some way this technology hits some Diamond Age apex of cyberpunk inevitability, but the only way I would ever buy this thing for its intended purpose is if my kids had severe mental disabilities and nobody else in the world had ever seen a computer before.

I have never seen anyone fail so hard at failing to anticipate negative consequences and/or overestimating their ability to prevent kids from being kids. (It's kind of odd to see an unprecedented level of fail which remains too ambiguous to entirely classify.)

This startup idea has genius to it, for sure, but in my opinion, it represents such an awful and utterly unrealistic choice about differentiating users and customers that Facebook looks like 37Signals by comparison.

Don't Repeat Yourself: Fundamentals Edition

The text editor is the operating system.

The browser is the operating system.

The operating system is the operating system.

Thursday, November 8, 2012

My Los Angeles JS Talk On Automated Refactoring

I spoke recently at about an automated refactoring system called Wheatley (which lives on GitHub). Here's the talk:

Wheatley from JSLA on Vimeo.

Monday, November 5, 2012

Saturday, November 3, 2012

Improve Your Writing With A Checklist

Here's an easy way to write better blog posts.

First write out your idea, without concern for quality. Just express the thought at hand.

Next go through the text, eliminating the passive voice anywhere you find it.

Do it again for adverbs, and a third time for run-on sentences.

Making these changes always improves writing, no matter what the topic, style, or context. For bonus points, do a fourth review pass, looking for ways to eliminate repetition.

Finally, copy-paste your text into a word processor to get automated spelling and grammar checks for free.
Yes, I'm aware this blog post contains an adverb. These are rules of thumb.