I was re-reading tilly's Random thoughts on programming recently. The first point reminded me of one of my abandoned back-burnered Quixotic quests: convincing my labmates to take up code reviews.
Now, my situation is more difficult than most. I'm not a working private-sector programmer, surrounded by codebases that will be maintained for years or even decades as a matter of policy. I'm a grad student, and much of the code my labmates write is at least putatively of the "proof of concept, write the paper, forget about it" variety. (Never mind that a clever researcher can keep milking the same basic concept -- and codebase -- for several successful papers. It's called a "research stream", and is the pointy end of the spear in the fight against "publish or perish" administrations. But I digress.)
Point is, people don't really think about code maintenance -- and they especially don't think about software engineering principles. (I, of course, am clearly superior to my labmates -- as the (hang on, let me grep) twelve globals polluting my latest project can attest. Ahem.) We're more concerned with learning about our chosen disciplines than learning how to be better programmers.
That's not quite true; I was overstating my problem to make a point. There are a few people here who are, to varying degrees, interested in clean code and efficient hacking. I think the foundation's there, it's just buried under metres of hasty expedience and the wrong kind of laziness. The question is, how can I unearth and build on it?
My first thought is to offer my services as a code reviewer: I'll review your code, and <godfather>some day, and that day may never come, I may ask of you a favour</godfather>. That way, I can learn from their code, and when I suggest alternatives I might be able to kindle some interest in elegance and cleanliness.
Has anyone else tried (and, with luck, succeeded) to introduce code reviews to an initially unreceptive audience?
(Once I get code reviews in, I'll start on pair programming. I wasted hours today on an unrecognized dumbass attack that would have been immediately spotted by a half-conscious fellow-hacker sitting in a chair watching my vim session. Grr.)
--
Yours in pedantry,
F
o
x
t
r
o
t
U
n
i
f
o
r
m
"Lines of code don't matter as long as I'm not writing them." -- merlyn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |