GIGO: words unreadable aloud
Mishrogo Weedapeval
 

 

  Wednesday 22 June 2005
Programming as Teaching

Andy Hunt and Dave Thomas write about learning here and here (sorry 'bout the awful URL).

Programmers must spend their entire careers learning; the best programmers love to learn, and remain fascinated by their chosen subjects for several decades. Dave and Andy write to that learner, with good advice about mindful learning. If you're aware that you need to learn some skill or language or system or technique, then you have the opportunity to do so in a planned and measured way, and to make the best use of your learning time.

What do programmers most frequently need to learn? In my experience, we most frequently need to learn to assimilate huge, ancient, misbegotten, broken, heterogenous, poorly-structured C monstrosities. Legacy code. Cruft. How is it structured? Where is the overview? Where are the hot spots, where one might look for performance issues? Where are the ugly spots, where buggy code is most likely to be found? Where are the debugging hooks, functions designed to be called from the debugger, logging or debugging flags that can be turned on, unit tests that can be run?

Given the universal need for programmers to learn, you'd think that there would be more literature about the flip side: programming as teaching. Not teaching the computer things, but teaching the next poor schmo who'll inherit your code, what you did. Teaching your successor how your algorithm solves this problem, how it fits together, where the tricky bits are, what alternative solutions were considered, why they were rejected, and what was omitted because you didn't have time to "do it right". Seems to me that these mostly-contextual issues are given short shrift in most programming shops.

My suggestion to anyone writing or maintaining code ever, anywhere, and even to those inhaling a large body of code that's new to you: be more mindful about teaching ... write up little blurbs about things you learn, to smooth the learning curve for the next inheritor of that code [*], and of your modifications to it. Possible channels for this sort of thing include comments, design notes, occasional presentations or seminars or code reviews, and internal project weblogs.

Notes:

Michael Feathers' book Working Effectively with Legacy Code is worth mentioning here.

I wrote previously about Programming as Teaching ... here and (tangentially) here.

[*] It's entirely likely that the "next inheritor of your code" might be yourself, six months older.
11:22:52 PM   comment/     



Click here to visit the Radio UserLand website. Click to see the XML version of this web page. © Copyright 2007 Doug Landauer .
Last update: 07/2/6; 12:44:48 .
Click here to send an email to the editor of this weblog.

June 2005
Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
May   Jul

Previous/Next