Write An Excellent Programming Blog
Join the DZone community and get the full member experience.Join For Free
i want you to write. not just code. also words.
if you're a member of the open source community, you can help us by writing about programming, just as much as by actually programming. and writing helps you, too: you can become better known and promote your ideas.
even more importantly, writing is thinking. there is no more thorough way to understand than to explain in writing.
it doesn't matter how narrow your expertise is. if you know better than anyone how to parse new york city subway schedules, i want you to write about it. if you've taught your cat to care for a tamagotchi, i definitely want you to write about it. whatever your expertise is, show me what you know. then when i have a question about your specialty, i'll know to come to you for help.
for example, the author of happybase , a python driver for hbase, emailed me for advice when he began his project. he knew from my blog that i work on a couple mongodb drivers, and he had very sophisticated questions for me about connection pooling. working with him was stimulating, and it was a very efficient way for me to contribute to a popular project.
being known in your community as an expert or as a cogent explainer helps you. you're more likely to get patches accepted by projects, get talks accepted by conferences, get users, get a job.
writing an explanation of a bug requires you to think it through, better than any other technique. my faith in writing-as-thinking is so fervent that when i see a tricky bug my first step is to start an article. that is what i did when i hit a bug in pymongo's connection pool last year. it turns out that in python 2.6, assigning to a threadlocal is not thread-safe . i am not nearly smart enough, dear reader, to discover such an intricate race condition unless i consolidate each step of the discovery by explaining it in writing.
i notice roughly five formats among the best articles by programmers: stories, opinions, how-tos, how things work, and reviews. if you want to write but you haven't chosen a topic, or don't know how to approach it, this will get you started.
"i'm going to tell you a story about foo, how it taught me bar, and led to baz. first this happened, then that happened. and that's the story of foo."
- we had an outage, this is the post-mortem.
- i went to a conference, heard talks, met people, learned something.
- i survived a tough mudder and so did my fitbit.
- i had dwarf hamsters. they died. i grieved, then accepted.
we are innately interested in stories about people. you need not be confessional or icky. if i get to know you a little through your blog, your technical articles feel warmer, and i remember who you are.
"thesis. points of evidence. response to likely objections. restatement of thesis." just like we learned in high school. the most important thing is that you don't simply have an opinion, but you have a compelling and interesting argument to support it.
avoid useless controversy like "product foo is bad" or "bar is better than foo." you have nothing to gain by attacking others. mr. miyagi says: karate for defense only.
- foo is going to be the next big thing.
- bar works great with baz.
- open source authors have a grave responsibility to their users.
- it's okay not to contribute to open source.
- college students do career fairs wrong.
"doing foo is important under the given conditions. i'm going to show you how to foo. do this, then do that. there, now i've shown you how to foo. you should go out and do foo."
a how-to must be motivated: you must begin by telling your reader when and why it is important to know.
- how do you debug a crash, memory leak, or race condition?
- how do you cultivate an open source project?
- how do you prepare a talk?
- how do you run a conference?
- any time you solve a problem, write down how you did it!
how something works
"do you wonder how foo works? i'm going to show you how foo is implemented. it does this and that. now i've shown you how it works."
almost every technology i hold in awe has been easier to understand, when i read its source code, than i feared it would be. writing an explanation of it is a good excuse to dive in and find out.
a "how something works" article need not be motivated. sure, some readers might want to know how something works in order to use it better. but there are people like me who want to know how almost everything works, and we are your audience for this article. people who don't want to know can move along.
- how does the django orm generate sql?
- how does socket.settimeout() work?
- why does this python code raise a syntaxwarning?
- how does xrange work?
"i read, saw, played, or used something. this is what it is. this is what my experience was like. the thing has these strengths and weaknesses. in conclusion, it's best when evaluated by certain criteria."
it's tempting to evaluate a book, movie, game, or project on a good–bad axis, but this isn't very useful. mostly describe and analyze instead of evaluating. tell me what the thing is good for .
- technical books! they need not be recent, though staying abreast of publications in your area is good. reading a book with the intent to review it makes you read more closely, and teaches you about good technical writing too. here's my review of o'reilly's "building node applications with mongodb and backbone" .
- others' software projects. but be gentle.
- games, movies, music, books that are not about programming: writing reviews is excellent practice, and warms your blog.
how do you find an audience?
please don't care about reach. reach is not the aim of writing about programming. seth godin : "most of the time, you'll aim to delight the masses and you'll fail. so much easier to aim for the smallest possible audience, not the largest, to build long-term value among a trusted, delighted tribe, to create work that matters and stands the test of time."
since you don't care about reach, don't waste time on seo. your goal is not to get lots of hits. you aren't buzzfeed. random visitors aren't valuable to you, because you don't show ads. instead, your goal is to attract specialists in your field so you can share ideas with them. luckily, you can reach these specialists without much effort.
first, find the aggregator your community reads. i write a lot about python, and the planet python aggregator is by far my best channel for distributing articles. any article i put in the "python" category is included in its feed, and that guarantees a few hundred visits. write email@example.com to get included. (and be patient, it's run by volunteers with busy lives.) if you write about another language or technology with a large community, find its aggregators and request to be included in them.
tweeting your articles has some value. more valuable is posting your article on a relevant subreddit. and use your own home page to send visitors to your best articles , don't just display the most recent ones there.
you can try your luck on hacker news, but i have concluded that no one serious goes there, so i do not either.
how do you improve?
write. emulate the best bloggers and the best articles.
don't emulate daring fireball, gigaom, or techcrunch. these are industry news sites, ultimately devoted to one question: which companies' stocks will go up, and which will go down? this is not your expertise. besides, it's boring. emulate writers like these instead:
glyph lefkowitz. in "unyielding" , he argues that async's greatest strength is not that it is efficient, but that it makes race conditions easier to avoid.
kristina chodorow. "stock option basics" tells a personal story about quitting a startup and shares hugely important financial advice that has lasting value. her article on mongodb unittesting is very specialized, but i've referred to it many times since it fills a woeful gap in the mongodb developer docs. kristina's funny and amiable voice works well on her blog and in o'reilly's "mongodb: the definitive guide".
armin ronacher. his "exec in python" article is long, incredibly thorough, and timeless. it takes an hour or more to read. it took him days to write, i'm sure, and he continued correcting it after publication. it brings insights into the python 2 and 3 runtimes, how web2py works, and builds an argument for how it should work instead.
julia evans is loose and exuberant in her blog, the same as when she speaks. but don't be fooled, her argument for anonymizing conference proposals is meticulous. so is her guide to applying machine learning to business problems .
graham dumpleton's magisterial series on python decorators obsoletes all other writing on that topic.
how do you make the time?
writing doesn't have to be a regular time-suck, because there is no need to publish regularly or often. most of your value is in infrequent, deep articles. furthermore, there's no rush to write an article now, because the best subjects are evergreen. patrick mckenzie : "you can, and should, make the strategic decision that you'll primarily write things which retain their value. it takes approximately the same amount of work to create great writing which lasts versus creating great writing which ages quickly."
(that's my second link to the same essay, it's that good.)
so take your time. when you have a good idea or an unusual experience, you'll be moved to write.
you know something very specific about programming that's worth explaining. or you have a new way to explain a common topic. either way, i want you to share your knowledge in writing. explaining will deepen your understanding as nothing else can. if you don't know what to write about, riff off the ideas i suggested, or get inspired by great blogs. craft articles of lasting value.
Published at DZone with permission of A. Jesse Jiryu Davis, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.