At the start of April, I'm switching 20% projects to become the head of
the readability intergrouplet at Google. Basically, I'll be to readable
code what I once was to testing at Google. Since so little of my 80%
project is bloggable, I thought I'd use this opportunity to give you at
least a little insight into some of the stuff that I'm working
on.
Let's say you work for Google (welcome! here, have some pancakes) and
you decide you have some code that you'd like to contribute -- there are
a few approvals you need before you can submit it. For non-programmers,
one of the easiest analogies for understand this stuff is that you work
for an encyclopedia company and you'd like to contribute a new entry to
the encyclopedia.
First, you need someone who owns that section of code to approve
it. In the encyclopedia analogy, you need one of the editors of the
Japan section to say that your article on Japanese Fishing looks good.
These editors are probably looking to make sure that your content is
correct.
Next at Google, you need to be readability approved in that
language. Back to our encyclopedia analogy, the company doesn't want
bad grammar to ruin a perfectly good encyclopedia. So either you, or
your editor, or an additional editor you can bring in, have to be
"readability approved" in French, which is essentially a certification
saying that they are reasonably likely to catch any grammar mistakes in
French. At least one person looking at your code (including yourself)
has to have readability in the language you're working in. If you're
working in multiple languages, you need multiple readability
approvals.
The purpose behind this readability check is to keep a consistent look
and feel across a huge and ever-growing codebase. Now a lot of these
rules are ones which have no real answer: for example, can you say
"can't" or do you need to say "can not"? This is something that a group
of language enthusiasts decide upon and make a list of rules about.
It's not that these are the right answers, it's just that these
are the style guidelines that have been decided upon to create a
consistent tone.
In order to actually get readability in a language, you have to undergo
something called a readability review. Basically you submit a
piece of code to a specially-designated readability expert in that
language and the two of you go through it together to find mistakes and
improve your coding style. I've done this now in Python, Javascript,
Java, Sawzall and Actionscript, so I can submit code in any of these
languages (with the approval of someone who owns that bit of code; the
first check, remember?) without requiring any additional reviewers. If
I want to submit C++ code, however, either my reviewer has to have
readability in it, or I need to find an additional reviewer who has C++
readability to approve it. Once I work in C++ enough, I'll probably
look into getting readability in that too in order to avoid this extra
step.
Okay, so you know that specially-designated readability expert I
mentioned earlier? The ones who can certify you as having readability
in a certain language? So right now (before this change in April) I do
that in Python. I'm one of the Googlers you can go to if you want to
obtain Python readability. You can get your Python code readability
approved by anyone who has passed this test. Still with me? I certify
you as having Python readability (once), and then you can review
someone's Python code any number of times in the future.
Now in every language we're goverened by a readability captain. So, for
example, my readability captain in Python's job is to make sure there
are enough of us to handle all of the incoming requests for readability
tests, handle conflicts as they come up, etc.
So what I'm going to be doing starting in April is managing these
captains across all the different languages. Making sure that they can
do their jobs correctly, that the process is smooth, keeping the
readability policies into something that actively reflects what works
best for Google, helping with the infrastructure to keep this all
working, and creating a sort of support community behind those who
volunteer their time to help out with readability tests.
It may seem a little complicated from the outside, but all that most
Googlers have to worry about is: "do I have readability in this
language, if not does one of my reviewers"? And, sometimes, "maybe it's
time that I get readability in this language". The rest of it is magic
that happens behind the curtain.
And that, in a quick nutshell -- not to be confused with the slow
nutshells -- is readability at Google. If I remember, maybe I'll post
about some of my team's upcoming launches as they happen so that you
guys can see what I do in my 80% time.

