• 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

    #31
    Read CodeComplete2. It is the bible for programmers on this subject.

    In summary:
    Comments should not be pseudo code.
    Comments should not paraphrase code.
    Comments should add value to a code section, where it is not immediately obvious to a competent programmer what is going on.
    Originally posted by cailin maith
    Hang on - there is actually a place called Cheddar??

    Comment


      #32
      Originally posted by christhecontractor View Post
      RW is not a nice chap. I bet he's an agent.
      Bless. This is general, you have to take the rough with the smooth...
      Older and ...well, just older!!

      Comment


        #33
        Originally posted by FSM with Cheddar View Post
        Read CodeComplete2. It is the bible for programmers on this subject.

        In summary:
        Comments should not be pseudo code.
        Comments should not paraphrase code.
        Comments should add value to a code section, where it is not immediately obvious to a competent programmer what is going on.
        (Serious mode on) - Good advice.... (SM off)

        (Less SM on)
        I am a competent coder (so my comments are great/not needed).
        He is a donkey (so his comments are pointless and his code is tulip and he isn't fit to read my code)

        Comment


          #34
          I pride myself in being good at delving in and figuring out other peoples' code, but I know from experience not to pay too much attention to either comments or documentation. They're typically either plain wrong, or incomplete, usually written because the programmer was told to and not checked by anybody else for usefulness.

          Current ClientCo. want me to write a comment block at the start of every function with a change history of that function. I've made the point that that's what source control is for, but they haven't changed the policy yet.
          Will work inside IR35. Or for food.

          Comment


            #35
            Comments are bad

            Developers should write little or no comments. Comments are bad and often lie.

            If you want to know what a class does look at its unit test.

            You DO all write unit tests...?!
            Cats are evil.

            Comment


              #36
              Originally posted by swamp View Post
              Developers should write little or no comments. Comments are bad and often lie.

              If you want to know what a class does look at its unit test.

              You DO all write unit tests...?!
              Please don't tell programmers to test. Their bugs finance Tester Manor.
              And what exactly is wrong with an "ad hominem" argument? Dodgy Agent, 16-5-2014

              Comment


                #37
                Actually the most annoying ones I find are..

                // Fix for bug #196, Fix By Joe Bloggs, 12/12/03

                I want to take people outside who do that and beat them about the head with a CVS manual until they know what a repository is used for.

                Comment


                  #38
                  Originally posted by VectraMan View Post
                  Current ClientCo. want me to write a comment block at the start of every function with a change history of that function. I've made the point that that's what source control is for, but they haven't changed the policy yet.
                  What happens when you need to merge two functions? Or delete one? Or refactor one out into a bunch of new classes and functions as part of a pattern?!

                  Cats are evil.

                  Comment


                    #39
                    Someone I know cut and paste some code from the internet (including comments) and put it in production code. The comments were in Spanish, but he thought he better leave them in.

                    During testing it was found that the code didn't work. After putting the Spanish comments through google translator it came out as "This code is an example, and I can't get it to work, not sure why"
                    Last edited by FSM with Cheddar; 23 January 2009, 14:31. Reason: spelling
                    Originally posted by cailin maith
                    Hang on - there is actually a place called Cheddar??

                    Comment


                      #40
                      All you chaps with your new fangled languages (C ? wtf is that?) should try decyphering RPG2 without comments.

                      It's a complete cluster****.
                      ‎"See, you think I give a tulip. Wrong. In fact, while you talk, I'm thinking; How can I give less of a tulip? That's why I look interested."

                      Comment

                      Working...
                      X