Decorations

  • TomThomson

    SSC Guru

    Points: 104773

    Ed Wagner (1/2/2016)


    I'm pretty particular on the formatting of my code, for the very reasons of readability and maintainability. I can write format that'll confuse anyone, including myself, but why on earth would I let haphazardly-formatted code into production. It inhibits progress during development and later modifications, so it's a serious disservice to myself and others.

    On a related note, I also take the radical step of including comments. If nothing else, it'll tell me what I was thinking when I originally wrote it. If it's been two years since I touched it, I really benefit from seeing the overall approach and comments I left myself. I also really appreciate it when others do the same. An important point is to update the comments so they match the code.

    None of this is really controversial and shouldn't take anyone off-guard. However, it's still something many people don't do.

    I have tended to write comments since the time (about 1979, I guess) one piece of code I had written started failing a few times a week on one particular customer site after it had been out in the field for over a year being executed 2880 times a day (this was a little routine in the OS Kernel's data comms software and a timer would activate it if there ever was as much as 30 seconds between activations) on each of a large number of machines belonging to a large number of customers as well as on quite a lot of in-house machines without any reported failures, and when I looked at it I couldn't see how it had ever worked at all anywhere; and when I got the team to look at it no-one else had a clue either. So that little routine was replaced by one several times as big that was thoroughly commented (and I don't think we ever got the original code to break anywhere else but that one site).

    Tom

  • Gary Varga

    SSC Guru

    Points: 82166

    Jeff Moden (1/2/2016)


    Ed Wagner (1/2/2016)


    I'm pretty particular on the formatting of my code, for the very reasons of readability and maintainability. I can write format that'll confuse anyone, including myself, but why on earth would I let haphazardly-formatted code into production. It inhibits progress during development and later modifications, so it's a serious disservice to myself and others.

    On a related note, I also take the radical step of including comments. If nothing else, it'll tell me what I was thinking when I originally wrote it. If it's been two years since I touched it, I really benefit from seeing the overall approach and comments I left myself. I also really appreciate it when others do the same. An important point is to update the comments so they match the code.

    None of this is really controversial and shouldn't take anyone off-guard. However, it's still something many people don't do.

    Heh... I don't write comments for other people. I write them for ME because I have a major CRS problem. 😛

    Yep. Comments are for the next person. Often the next person is the one who wrote the comments. Almost as often, those comments are still gratefully received.

    Gaz

    -- Stop your grinnin' and drop your linen...they're everywhere!!!

Viewing 2 posts - 16 through 17 (of 17 total)

You must be logged in to reply to this topic. Login to reply