Not my finest hour: Getting instructions on doing something I’ve already done

Last year, I sent some email to the people who run our team's check-in validation tool asking how I could add a new rule to the validation tests. One of the members wrote back, "You do it just like this guy," and sent me a reference to another check-in that added a validation rule.

That other check-in was made by me.

But wait, it gets better.

That other check-in? It added the very rule I was thinking about adding.

Comments (24)
  1. SRS says:

    What ever you do, don’t lose face. Check in the duplicate code, and argue that twice the code is twice the goodness.

  2. Doug says:

    Remembering all the details about all the systems you work on is impossible.  I regularly find some module/change/whatever that I think needs doing is something I’ve already done…

  3. Ben Hutchings says:

    That’s just a glitch in the matrix.

  4. bramster says:

    and I thought it was just me, in my dotage. . .

  5. Reinhard says:

    Wondering how you came to the conclusion that the rule was not already there…

  6. Sometimes it happens… Once I googled for a problem I had with a datagrid and I found the solution posted in my own blog.

  7. Koro says:

    Happens to me all the time with my code.

  8. Chris says:

    Those who do not remember history are doomed to repeat it.

  9. Mats G says:

    I’ve gone through the halls looking for the guy responsible for maintaining some particular program, only to find people giving me that weird look and saying "aren’t you the maintainer of that program?"

    Happened twice.

  10. Dave Oldcorn says:

    Ah well, we all need an idiot board in the office.

    My finest hour? minlog2 = (log2y < log2y) ? log2y : log2y;

  11. At least it’s not as bad as looking through a source, that you wrote, but you don’t understand what the hell you coded, or how you came up with that angle in the first place, and end up feeling like you need to rewrite it all, because you doubt your own code…

    Happens to me more than I’d like to admit. *laughs*

  12. hagenp says:

    …but is it not woderful if you got the task to extend some module (add a function point), and then to discover a comment on how to add it.

    (When checking who wrote that comment then I discovered that it was my earlier self from two years ago.)

    * Some tasks are only held in a more or less big cache — if this is flushed you have to regain context.

    * Commenting code helps not only other people to maintain it, but also yourself.

  13. Robbie Mosaic says:

    Ah, that’s my thought about code readability: after leaving some code for a while, not able to remember every detail means that I’d like the code to be understandable, so I wish the code to have good design documentation and enough comments, though sometimes this isn’t the fact :)

  14. Igor Levicki says:

    >My finest hour? minlog2 = (log2y < log2y) ? log2y : log2y;<<

    Was that a result of a copy/paste operation?

  15. Igor Levicki says:

    >My finest hour? minlog2 = (log2y < log2y) ? log2y : log2y;<<

    Was that a result of a copy/paste operation?

  16. Tom says:

    My least favorite?  Looking at code I’ve written years ago and wondering "was I on drugs when I wrote that?  It’s an order of magnitude more complicated than it ought to be."  

    Then I simplify it and… it doesn’t work.

    I spend hours debugging code that ought to work, damn it. After about 6 hours of tedious and ever more mind-numbing debugging, I find the problem.

    It’s a bloody compiler bug/library ambiguity (thank you Java)/OS bug.  Suddenly my memory clicks.  I remember being outraged that my beautiful clean code was going to require an enormously clunky work-around.

    Of course, a lesson like that made me remember to do lots of "this might look stupid, but I wrote it this way because…" type comments for myself, but I’d been programming for enough years at that point that I had 4 or 5 years worth of these little gems to find over the next 20.

  17. Mike Fried says:

    This story was great. Thanks for sharing it.

  18. I've done that says:

    I know at least once i saw some code and thought, "what idiot wrote this?" Only to discover that I wrote it.

  19. Simon Cooke says:

    Hehe… yeah… I’ve been there and done that too. Several times I’ve been looking for solutions to some random problem, and hey presto, there’s me on a newsgroup telling someone else what the solution to that random problem is.

    I figure it’s a me from the future, who has finally cracked time travel, and is just screwing with me.

  20. Chris says:

    Those who do not remember history are doomed to repeat it.

  21. Friday says:

    Those who do not repeat are doomed to remember it. :)

  22. Dave Oldcorn says:

    >>My finest hour? minlog2 = (log2y < log2y) ? log2y : log2y;<<

    Was that a result of a copy/paste operation?

    Afraid not, straight out of my fingers, merely with no brain involvement. While I am someone who does sometimes err on the side of copypaste when if I thought about it retyping would be quicker, that wasn’t one of those times.

Comments are closed.

Skip to main content