Logo

Who is talking?

Archive

My Writing Process

9 months ago | Daniel Higginbotham: Flying Machine Studios

The letter below is a response to an email from a Twitter friend. For context: I've written some instructional material that's enjoyed success online, including Clojure for the Brave and True and Clean Up Your Mess: A Guide to Visual Design for Everyone. Robert asked me a few questions about my process. Hi Robert! You're in the unfortunate position of being my permission to write at length about my creative process without seeming completely self indulgent: someone's actually interested in listening to me describe the chaos between my ears! Be prepared to read way more than you asked for. How do you decide who you are writing for? This one’s key for me. When I’ve written in the past, I’ve struggled with knowing how much or how little to say. I’m curious to learn how you deal with that. First: I've found it useful to follow the standard advice and pick an individual or two and write for them. The argument goes that you'll find it much easier to choose words and have a consistent tone, and that's proven true for me. When I wrote Clean Up Your Mess, I was one of three programmers working in an office full of charming people who did business analysis for management consultants, and I wrote the guide for a couple of them that I had become friends with. These analysts produced powerpoint decks by the barrel, and every single one was ugly. Similarly, Clojure for the Brave and True started as a guide for a couple coworkers that I was mentoring. However, picking your audience is only half the process. The other half is picking who the author is. I'm going to go on a bit of a tangent to explain this. When I started writing Clean Up Your Mess, my personal life was a mess. In hopes of making it less messy I had been spending most of my free time reading Buddhist literature and listening to lectures by Thich Nhat Hanh and Pema Chodron (in fact, my site opens with a Thich Nhat Hanh quote). I was spending a great deal of time meditating and reflecting. (You're interested in Buddhism too, right?) One of the ideas that really grabbed me was that our self-conceptions are just stories we tell ourselves with no reality to them. I won't belabor the point here; suffice to say that I found it useful and powerful to be able to perceive my identity as a construct as ephemeral as smoke. Around the same time, I started taking improv comedy classes, where I would spend two hours a week constantly coming up with new, unique characters and living in them for a few minutes at a time. When you're sold on the idea that your day-to-day you is itself just a character, improv becomes way easier and more fun. It's also fun to do this in real life - like, recently my wife and I were at the grocery store and I decided my character was "Super Excited About Carrots Guy", and I started shouting "OH MY GAWD JESS CARROTS! THEY HAVE CARROTS JESS! CARROTS!" Everyone was laughing as they escorted me out! Anyway, during this time of buddhism and improv I was writing Clean Up Your Mess and when I sat down to write I got to play with new identities, new characters, and see which was the most fun. It became much easier to find words and keep a consistent tone when I decided on the author's character. So, you mentioned not knowing how much or how little to write. Knowing your character helps. In Clojure for the Brave and True, one of my editors would sometimes whittle down sentences to the bone, leaving only pure information; I would undo those edits with gusto, adding back the shape and texture of the author's voice. There's another aspect of writing instructional material, which is that 95% of the time you can take more time to explain something. Even if you're writing for experienced audiences, at least take the time to explain acronyms and jargon. How often and how much do you write? Not enough and not enough! Writing was easiest, however, when I had a consistent schedule of writing at least one hour every single day. Let me tell you about my garage. My garage is a living f*cking nightmare. It's like Cthulhu and the dread of the dark you had as a child made disgusting love and produced a horde of horrors that died in giant filthy clumps all over. At the beginning of the year I suppressed my gag reflex long enough to clean it out with the goal of setting up a photo studio, which I did, only to let it sit for three months. So three months later I go in there to actually take photos and guess what: it's a complete horror show, again! If I had only spent time every day or even every week maintaining it, I'm sure it would have been much easier to keep clean. If I had cleaned it out, all those tiny insect monsters wouldn't have been able to breed, there wouldn't have been two dozen spider egg sacs, etc. When I don't write consistently it's like that. I have to crawl into the nest of no one cares what you write and this time everyone's going to hate it called my mind and clear it all out before I can actually start writing. When I write consistently, on the other hand, it's actually quite pleasant! One more note: much of the writing process is research. Every time I find myself struggling to explain something, it's because I don't understand it well enough. When that happens I put down the keyboard and pull out the pen and notebook. I try to articulate the questions that will lead me to understand what I want to explain. I read and I draw diagrams and play with words until I feel like I understand the concept. Becoming aware that, for me, writer's block is a lack of understanding, has helped me be much more productive. Collaboration Who does your drawings? My wife! She's pretty great. Do you have someone who edits for you? I did when I worked with No Starch. They were awesome! Clojure for the Brave and True is much, much better because they kept pushing me to write more clearly and explain things more fully. For other projects, I'll ask friends to look at drafts. How much does it cost? I paid my wife in carrots. OH MY GAWD JESS THEY HAVE CARROTS! No Starch gets 85% of hard copy sales and 77.5% of ebook sales (or something like that). I hope this was helpful!

Understanding Recursion

10 months ago | Daniel Higginbotham: Flying Machine Studios

During my Clojure training I've found that recursion routinely trips people up. It definitely tripped me up for a long time. I've tried to develop an explanation that's clear and intuitive, so if you're still scratching your head about recursion, read on! A classic recursion example is calculating n factorial, which is n multiplied by every natural number before n; 3 factorial is 6 (3 times 2 times 1), 4 factorial is 24, 5 factorial is 120. The code snippet that follows is a typical implementation of factorial; if you're reading this, then presumably it's confusing - which is great! It means that I haven't written this article for nothing. function factorial(n) { if (n == 1) { return n; } else { return n * factorial(n - 1); } } What makes this function recursive is that factorial calls itself. That's also what makes the function tricky; the function calls itself!? We're used to functions calling other functions to get work done. For example, this function uppercases a string and prepends "Yo, " to it: function yoShout(str){ return "Yo, " + str.toUpperCase(); } yoShout("gimme a donut"); // "Yo, GIMME A DONUT" In this tiny example, yoShout does its work by using the toUpperCase function. It's easier to understand than a recursive function because yoShout treats toUpperCase as a black-box abstraction. You don't have to tax your brain by loading toUpperCase's implementation details into your short-term memory. Let's re-write factorial to use function calls this way, with function's body calling another function in order to get its work done. To calculate 3 factorial, you could write a series of functions, factorial_1, factorial_2, and factorial_3, like this: function factorial_1() { return 1; } function factorial_2() { return 2 * factorial_1(); } function factorial_3() { return 3 * factorial_2(); } These functions feel safe and comfy. factorial_3 calls factorial_2, something we're completely familiar with, and likewise factorial_2 calls factorial_1. factorial_3 also does not care how factorial_2, just like in the string example. Unfortunately, these functions are also completely impractical; can you imagine writing factorial_1000? The recursive implementation doesn't have this problem. My suggestion is to try seeing the recursive implementation from the same perspective as the nonrecursive imiplementation. Here's the code again: function factorial(n) { if (n == 1) { return n; } else { return n * factorial(n - 1); } } You can look at this and say, "Oh, if n isn't 1, then this function does its work by calling some black-box function named factorial with the argument n - 1." You can look at the call to factorial(n - 1) as a call to a completely different function - one that just happens to have the same name and algorithm. That's it! I hope it helps. If you've been confused by recursion, I'd love to hear your feedback!