Sunday Selection 2013-05-05

Happy Cinco de Mayo and Orthodox Easter everyone. Last week has been a bit quiet as far as reading is concerned. I have a hefty backlog in my RSS that probably won’t get cleared till next week. But here’s the pick of what I did read and discover:

Around the Web

10 Rules of  a Zen Programmer I’ve been doing meditation on a regular basis over the past few weeks and it’s been an interesting experience. I definitely feel calmer throughout the day and it’s getting easier to sit down and focus on tasks I would normally procrastinate on. This article agrees closely with both what I’ve been experiencing while meditating and as a programmer. I’m not a Zen practitioner, but you don’t have to be one to use the information this article provides.

I’m still here: back online after a year without the Internet This is the last (I think) in a series of articles by a journalist who spent a year offline. It’s an interesting read, though it ends on a very weak note. The author’s experience seems to agree with my own views on the matter: the Internet (and technology in general) is a tool and it’s up to us to use it best. Using it, or not using, is not suddenly going to make us a better or worse person. It’s up to us to use these tools according to our desires and help realize our potential.

Star Wars: Online review culture is dotted with black holes of bad taste This articles looks at the rise of popular review sites (focusing on Yelp and Amazon) and discusses how the reviews on these sites are often less then helpful to the point of negating the importance and usefulness of a review. There’s research going on at Cornell on better analyzing online reviews and review systems so this article was particularly interesting to me. While there’s something to be said for the usefulness of multiple opinions from different viewpoints, sometimes you just want an authoritative answer from an expert about the quality of a service and product, and that’s increasingly difficult to come by.

Software

Tomato.es As the end of the semester approaches and the amount of stuff I have to get done explodes, I’ve been starting to use the Pomodoro technique to keep on top of things. Tomato.es is a simple timer that counts off 25-minutes intervals. If you sign in using Twitter or Github, you can keep a record of what you’ve been doing in those intervals.

Breakfast

Note: This is a boring personal-ish post while mainly to help get back into the habit of writing regularly. If you’re not interested in what I had for breakfast (literally), please check back next week when I’ll have something more interesting to say.

After a few months of trying I’ve managed to get into the habit of making and eating breakfast everyday. A healthy, high-protein, slow-carb breakfast takes me about 20 minutes to cook, eat and clean up. This includes setting up the coffee machine at some point (but drinking the coffee takes a bit longer). 20 minutes is about the length of one episode of any number of TV shows. My choice so far has been the US version of The Office so far. But a few days ago I cancelled my Netflix account for a variety of reasons, not the least of which is wanting to watch less TV. While I’m glad to have the $20 (and the uncounted hours) of savings per month, it leaves the question: what do I do during breakfast?

I could do nothing — just cook and eat breakfast without anything else, but that’s not really my style. While I’m all for being comfortable with solitude, making and eating breakfast in complete silence, all by myself, is a bit much. At the same time, I do enough reading and writing each day as is and I don’t really want to do more of it first thing in the morning. What I would really like is some kind of semi-passive activity that doesn’t shut down my brain in quite the same way that TV does.

To that effect, I’ve been thinking: podcasts. Unfortunately my knowledge of podcasts is pretty limited. I used to listen to some technology podcasts a few years ago, but that kind of thing no longer interests me. (I’d rather be working on the cutting edge of tomorrow’s technology than keeping up with the latest Apple product or Valley startup.) I’ve subscribed to some podcasts that friends have mentioned including NPR Technology, Freakonomics and Debbie Millman’s Design Matters. While I like each of them, they’re generally much more than 20 minutes and usually vary in time. While I enjoy listening to longer podcasts while doing chores and such, my mornings are usually pretty tight and I don’t want to spend more than 20-30 minutes on breakfast related things.

So it’s audience participation time: what are some interesting podcasts that don’t have a popular tech or productivity focus and are reliably 20 to 30 minutes in length? Failing that, what are other mostly passive things I could be doing over breakfast?

What do you do to break a creative block?

I’ve been wanting to get back to blogging for a while now. Unfortunately a combination of graduate student life and not wanting to spend even more time than I already do in front of a computer has made me put that off. At the same time, I’ve been having some bursts of activity on Quora. I think Quora is an interesting site and serves a a good purpose, but I’m not very happy about its Walled Garden policies and I would like the information I put in to be more generally available (at least the stuff that doesn’t involve the more obscure points of Tolkien’s legendarium). So for today at least I’m going to report an answer I wrote up while i was waiting for my experiments to finish.

The post asked about overcoming creative block, in particular writer’s block. The poster said that time was sometimes, but not always a factor and that s/he had been writing quite prolifically before. (The previous sentence made me realize that English desperately needs a gender-neutral third-person pronoun that isn’t ‘it’.) Given my blogging predicament, I avoid this uncannily relevant. Anyways, without further ado:


Personally I’ve found that what helps is a combination of three things: good routine, new experiences and boredom.

First, routine.  If you’re having trouble getting time to write, or trouble sitting down to write even when you have time, a strict routine can definitely help. As Somerset Maugham supposedly said : “I write only when inspiration strikes. Fortunately it strikes every morning at nine o’clock sharp.” Find a quiet space, free of people and distractions, grab some coffee (or tea, or just water), turn off the Internet and your phone and just write. Write anything. It doesn’t have to be in your preferred genre or what you’re trying to write. It can be an essay, a journal entry, a letter to friend (or an enemy). The point is just to get into the habit of writing. Once you’re comfortable with sitting down for some time each day and just writing something you can move on to what you actually want to write.

Second, experiences. If you’re going to be a serious writer then it helps to have things to write about. While it’s definitely possible to create interesting by isolating yourself in a cabin in the woods (see Walden by Henry David Thoreau), I think it’s a safer bet (and far more interesting) to gather lots of interesting experiences and ideas and weave them together in interesting ways. Travel new places and keep your eyes, do things you thought you’d never do, talk to people you normally don’t interact with, eat foods that look strange and unfamiliar, look up random topics on Wikipedia, explore a new subject each month. The more ideas you have in your head, the easier it will be to have things to recombine and use as a basis for interesting writing.

Third, boredom. As a complement to the above, as you’re gathering experiences you need to have the time and energy to put them together. Spend a Saturday on the couch (or the hammock if you have one) with the TV off and without any people around. Stand in the checkout line and just stand. Get bored sometimes, don’t rush the mindless things like doing the dishes and vacuuming. You need to put interesting things in your head but you also have to give yourself the chance to let them interact and recombine. This part is often hard to do because you feel like you should be doing something productive, but I believe this stage of just letting ideas percolate and react is crucial to any creative activity.

Finally, to make the most of the above: carry a notebook and pen always. It doesn’t have to be a fancy Moleskine or anything of the sort. It just needs to be something where you can record interesting experiences and ideas and look back on them later.

Good luck and good writing.

Coding standards are communication tools

I’ve been writing a lot of C code over the past few months. It’s been fun and I’ve learned a good amount about writing solid, low-level, procedural code. While cranking out code I’ve also been developing a simple coding standard, mostly for my own use and based on on the K&R standard. I’m not working with a particularly large group (and probably won’t be anytime soon) so I won’t be asking anyone else to follow these standards anytime soon. They don’t follow the rest of the code 100% either. But even being essentially the lone hacker on the project, I’ve found sticking to a standard helpful.

C is a great language but often I want to say things as part of the program that I can’t put in the code. For example, there are often things about variables that aren’t captured by the type and even if they are, I don’t want to have to look up the type every time I see the variable to get that information. But by following simple rules about how my variables are named, I can pack in a lot of information. For example, a plural name is an array, a name prefixed with num_ indicates that it holds the number of something in the system, a name prefixed with rv_ means that it stores the return value from a function (probably for error handling). Outside of variables, function names are verbs, locally defined types meant to be private are CamelCased, exposed types have a _t suffix. Of course, these don’t apply in all cases and some amount of discretion is involved.

Following a standard like the above has a double benefit: first I can think less when it comes to naming things and it prevents casual naming conflicts. Secondly, as I hinted to above, it’s a communication aid. There’s a certain amount of information that is encoded into the language’s syntax and semantics. This layer is checked and enforced mechanically at compile time. But a coding standard allows for a secondary, optional layer that can convey more information without expanding the language standard (and allowing teams and individuals to develop their own, suited to the task at hand).

Note that I’ve mostly talked about naming conventions and I haven’t said anything about formatting. Personally I think formatting conventions are less important and helpful. It can be annoying to read code that is formatted differently across files (or in the same file), but I think the benefits to be gained from consistent formatting are less than that for consistent naming. In fact, I think that formatting issues should be eliminated by having a tool that will automatically reformat code to a single standard. I have the Go language’s gofmt tool in mind, but I’m sure there are others. (This is also one of the pet peeves I have with Haskell: it’s apparently really hard to write an auto-indentation tool for its syntax)

One caveat is that I have no personal experience as to what effect a coding standard has across a large group. I’ve found two articles arguing against coding standards on teams, but they’re both far too emotional and hand-wavy for me to take them seriously. Personally I would be wary of a developer who can’t adapt to a coding standard in a reasonable amount of time. That being said, there are definitely more important things than adhering to a standard (getting working code for one). However, I do think that coding standards fit into a larger culture and system of good coding practices. These include things like code review, appropriate use of version control and proper communication channels to talk about bugs and feature changes.

To conclude, a coding standard can be a great tool for personal uses. In some ways it frees up my limited mental RAM to think about more important things. It also allows me to pack more information into my code, outside of what the language syntax or semantics allow. I’m less certain of the benefits for large groups and as Emerson puts it, a foolish consistency is the hobgoblin of small minds. That being said, I’d like to believe that a good coding standard (with formatting mechanically enforced) along with practices like code review can lead to a higher code quality.

Tsuyoku Naritai

Happy New Year, dear readers (albeit somewhat belatedly). I’ve been spending most of the last month traveling and spending time with family and friends. And now I’m going to tackle the matter that is on everyone’s mind at this time of the year: New Year’s Resolutions! Aren’t you all excited?

I’ve never been a fan of making a long list of resolutions on January 1. There’s an arbitrariness to it that I’ve never found appealing. I understand the need for a New Year’s Day for practical purposes, but it is really just another day. It doesn’t even commemorate someone’s birthday or a memorable event. Furthermore, grand announcements of how we’re going to change our lives have always seemed unnatural. Most of the changes in my life (and I’ve changed a lot over the last few years) have been sequences of events, opportunities and small decisions building up over time, not sudden all-changing promises.

All that being said, I am a fan of the general notion of self-improvement. A few months ago I came across the Japanese phrase “Tsuyoku Naritai” which translates to “I want to become stronger”. The original article by Eliezer Yudkowsky is worth reading and I won’t bother repeating it here. It focuses on the idea of improvement (getting stronger) as opposed to the idea of simply apologizing for weakness (and not doing anything about it). But the concept of Tsuyoku Naritai presents an interesting contrast to the idea of New Year’s resolutions.

I have always felt that resolutions were mostly external motivations: they embodied things that we thought we should change, that we were constantly being told we should change. By contrast I feel Tsuyoku Naritai is more intrinsic. It’s not “I should” or “I will”, it is “I want”. It acknowledges that we may not have strength now, but it declares that we want to gain it.

“Tsuyoku Naritai” is more general than most resolutions. While I’m all for specificity of goals, the start of the year might be the wrong time for them. Making serious changes takes a lot of willpower – something that we have a finite supply of. Deciding to change our diet, our exercise routine, our work schedule and how we spend free time all at the same time is a fool’s errand. The need for willpower can be mitigated by making use of habit – putting things on autopilot. But setting a new habit takes about a month and in that time we’re burning precious willpower reserves. We may be able to completely change all the spheres of our life over a year, but we certainly can’t do it all at the same time. Instead of making lots of specific promises at the start of the year, maybe it’s better to pick an over-arching theme. We can pick a goal a month that to devote our willpower to and set into a habit.

This year I don’t have a set of resolutions. I do have a list of things I want to accomplish over the course of the year, but I’m taking them one at a time. But in addition to those specifics I have a more general theme of wanting to be stronger – physically, intellectually, maybe even mentally/emotionally (though I’m not entirely sure what that would entail). Tsuyoku Naritai is my theme for 2013 and something I hope to revisit as the year progresses.

I hope you all have a happy and productive new year. Live long and prosper. Become stronger.