On Sat, Dec 07, 2013 at 08:07:08PM -0800, Walter Bright wrote: > On 12/7/2013 6:07 PM, Manu wrote: > >At least in certain types of code, which perhaps you don't spend an > >awful lot of time writing? > > Funny thing about that. Sometimes I'll spend all day on a piece of > code, then check it in. I'm surprised that the diffs show my changes > were very small.
At my job, we actually take pride in minimizing our diffs. My manager once mentioned that sometimes, it could take days to produce a one-line diff, because it takes that long to (1) find the bug and (2) figure out the least intrusive way to fix it. Diffs that are obviously larger than necessary (esp. with frivolous whitespace changes) will often be rejected during the code review process, or, at the very least, the submitter will be told to rework his diffs to avoid touching stuff unrelated to the actual code fix. (Sadly, this isn't done during feature branch merges, and so a lot of poor code tends to creep in through feature branches. Sigh. Can't have your cake and eat it too, I guess.) > I suppose I spend far more time thinking about code than writing it. When I was in school, I was taught to do that. I think I take it to the extremes, though. Sometimes I'd think about a piece of code for months before actually writing it because I just can't sort out all the details in my head. Often I have to force myself to just start writing the code, and then the details I was worried about tend to work themselves out quite nicely. Now obviously, starting to write code without the slightest idea about what kind of algorithms should be used, etc., is a bad idea, and tends to lead to bad, non-maintainable code. But thinking about it too much leads to non-productivity. So there's a balance to be struck somewhere, but I'm still trying to figure out where that is. :) T -- "A one-question geek test. If you get the joke, you're a geek: Seen on a California license plate on a VW Beetle: 'FEATURE'..." -- Joshua D. Wachs - Natural Intelligence, Inc.
