can all be in one main() function. I
recommend that you find a few such
programs—well written, well commented, and that do one thing and do
it well. Then make your Padawan read
them and explain them to you.
KV has extolled the virtues of reading good code as a way of learning to
write good code, and for young readers, short programs are best. Even
though you are working on greenfield
code—a rarity in our industry—there
must be some scripts or code lying
about that you do not hate and that
extol the virtues you wish to instill in
this apprentice. The most important
part of any of these programs is that
they do one thing, they do it clearly,
and it is obvious to even the most
inexperienced programmer what is
going on. Find that code, explain its
beauty, and then make them extend
and maintain it.
Since you both are working on the
same code base, you also have ample
opportunity for leadership by showing
this person how you code. You must do
this carefully or the junior programmer
will think you are pulling rank, but,
with a bit of gentle show and tell, you
can get your Padawan to see what you
are driving at. This human interaction
is often difficult for those of us who
prefer to spend our days with seemingly logical machines. Mentorship is the
ultimate test of leadership and compassion, and I really hope you do not
wind up sliced in half on the deck of a
planet-smashing space station.
KV
Related articles
on queue.acm.org
Human-KV Interaction
Kode Vicious
https://queue.acm.org/detail.cfm?id=957782
Reading, Writing, and Code
Diomidis Spinellis
https://queue.acm.org/detail.cfm?id=957782
A Conversation with Steve Bourne, Eric
Allman, and Bryan Cantrill
https://queue.acm.org/detail.cfm?id=1413258
George V. Neville-Neil ( kv@acm.org) is the proprietor of
Neville-Neil Consulting and co-chair of the ACM Queue
editorial board. He works on networking and operating
systems code for fun and profit, teaches courses on
various programming-related subjects, and encourages
your comments, quips, and code snips pertaining to his
Communications column.
Copyright held by author.
this often enough, clearly, because
I say it a lot. Someday I will lose my
voice, and the people I am screaming
at will finally think they will get some
peace; but if that ever happens, I have
a recorded version I can play through
a megaphone.
Communication is just a fancy
word for storytelling, something that
humans have probably been doing
since before we acquired language.
Unless you are an accomplished surrealist, you tell a story by starting at
the beginning, then over the course
of time expose the reader to more
of the details, finally arriving at the
end where, hopefully, the reader experiences a satisfying bit of closure.
The goal of the writer (or coder) is to
form in the mind of the reader the
same image the writer had. That is
the process of communication, and
it does not matter if it is prose, program, or poetry—at the end of the
day, if the recipient of our message
has no clue what we meant, then all
was for naught.
Of course, as many brilliant writers
have proven over time, clear narrative
is not entirely necessary, but let’s just
stick with the clear narrative metaphor for code, rather than claiming
we should write an accounting system
based on Naked Lunch. I mean, I would
enjoy it, but would it work? Only the
Mugwumps would know.
The concept of simple narrative
can be applied to code in the following way. We are trying to write down
the steps that are required to do a
particular job with a machine in such
a way that when other readers come
upon the narrative (code)—which is
usually thrust upon them with a bug
list as long as a baby’s arm—they are
able to pick up the story wherever they
choose. For a short program, something less than 100 lines, the narrative
The concept
of simple narrative
can be applied
to code.
Advertise with ACM!
Reach the innovators
and thought leaders
working at the
cutting edge
of computing
and information
technology through
ACM’s magazines,
websites
and newsletters.
Request a media kit
with specifications
and pricing:
Ilia Rodriguez
+ 1 212-626-0686
acmmediasales@acm.org
◊◆◊◆◊