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


In reply to Advocacy of code reviews: how the heck do you do it? by FoxtrotUniform

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.