• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

code comments

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    #11
    Anyone read showstopper by steve cutler?

    I thought the arguments they had over code commentating were interesting.

    Essentially no-one commented their code except Steve Cutler. Their argument being comments get out of date. He updated his comments as he went along.....

    Comment


      #12
      I was brought in at great expense, a 6 monther, onto one job to improve the up time on some system.

      5 minutes into getting a look see at the code I found:

      // time bomb

      IIRC I posted here, or maybe it was the previous board, in between the odd code tweak, for the rest of the contract.
      Insanity: repeating the same actions, but expecting different results.
      threadeds website, and here's my blog.

      Comment


        #13
        I decomissioned an application for GSK at Dartford and happened to look through the code out of interest. One of the comments(from 2001) was
        '==break out of the loop when we get a hit - it's a nice day. Full eclipse this am at 11. One of the girlies hurt her eyes looking at it


        The funny thing was , I knew the programmer. It was me

        They got me in to decomm my very own app




        (\__/)
        (>'.'<)
        ("")("") Born to Drink. Forced to Work

        Comment


          #14
          I remember a comment attached to the final option of a complex case statement.....
          Case 1....
          Case 2....
          ......
          Case n....
          Otherwise NOP // This shouldn't really happen!

          I never worked out which was worse "coding"
          a) the No Operation
          b) the comment

          Comment


            #15
            Originally posted by threaded View Post
            I was brought in at great expense, a 6 monther, onto one job to improve the up time on some system.

            5 minutes into getting a look see at the code I found:

            // time bomb

            IIRC I posted here, or maybe it was the previous board, in between the odd code tweak, for the rest of the contract.
            hahaha. The amazing thing is someone actually commented a timebomb - I never comment mine when I put them in!

            Comment


              #16
              when I started programming I was taught that comments should be comprehensive enough so that if all the code was ripped out and only the comments left then it would be straight forward enough for someone to rewrite the program.

              My comments vary from spartan to comprehensive depending on what its for.

              I write a lot of migraiton scripts, these get run a limited number of times and usually by myself so no need for comments.

              Interfaces which should survive past my contract end date get full comments
              -- Headers which include version info
              -- test scripts (i write SQL) so that someone debugging it already has a bunch of SQL to test the data with
              -- then the body of the T-SQL has numbered comments broken down by section. These are compiled at the top for documentation purposes then repeated on the line above the piece of code they refer to

              Anyone who needs to understand the stored procedure only needs to read the header and they could completely rebuild it

              When writing the program I usually start with the comments, map out exactly what I want it do to, where and why then build the actual code around that.
              Coffee's for closers

              Comment


                #17
                I recall years ago being told of a program written in assembler, that was hugely complicated, and stopped working. The developer responsible was on holiday, and couldn't be reached - no mobile phones in those day. The other programmers tried to work out what it was doing, and how to fix it, but there was only one comment, "BOH", at line 1066. This being the only place commented, it was felt this must be the important part of the code. But they couldn't work it out. They had to resort to some kind of manual workaround.

                When the developer returned from holiday - to very black looks - he was asked about the comment.

                "Oh", he said, "that's easy. 1066 Battle Of Hastings".
                Down with racism. Long live miscegenation!

                Comment


                  #18
                  Originally posted by Spacecadet View Post
                  When writing the program I usually start with the comments, map out exactly what I want it do to, where and why then build the actual code around that.
                  A "Code Monkey" who plans what is required from the code prior to writing it!
                  Next you will be telling us that you write code to fulfil/match some pre-defined specification. Keep secure Versions of your iterations and deliver code into testing environments that a) Works b) does what its supposed to do!

                  ... rather than just copy an existing bit of code, cut and paste a few blocks of other code into the middle - send it off to testing hoping that they won't discover its tulip before you go home for the weekend.......

                  What are you - a PROFESSIONAL?

                  Comment


                    #19
                    Originally posted by Drewster View Post
                    ... What are you - a PROFESSIONAL?
                    I think you'll find he's what's called an "on-shore programmer".
                    Down with racism. Long live miscegenation!

                    Comment


                      #20
                      Question.

                      Do you write comprehensive code comments, thus making the job much longer (kerrching) but making it much easier for someone else to pickup the code and replace you, or write cryptic comment free code that is quick to write (no contract renewal) but no bugger can pick it up (and get called back in on a new contract)?

                      Comment

                      Working...
                      X