• 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

    #41
    Originally posted by swamp View Post
    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?!

    Good question. I shall consult the coding standards document....

    Oh, it doesn't say.
    Will work inside IR35. Or for food.

    Comment


      #42
      Originally posted by FSM with Cheddar View Post
      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"
      This one will go in my book. Thank you. Just imagine how much of this crap actually reaches production environments because of Clients using numpty ' testers' from Accidenture, Cack Gemini and the like. I once challenged a ClientCo to let me test a copy of their production systems for a day. Some of the bugs I found scared the tulip out of them and it included things that should have been found in five minutes of testing, like a pension fund sending double requests to market traders, a telco whose user authorisation for management of a national network could be hacked by signing into admin apps as an unauthorised user and clicking through a couple of error messages, at which juncture you could remove the DB owner with all the horrific consequences.
      And what exactly is wrong with an "ad hominem" argument? Dodgy Agent, 16-5-2014

      Comment


        #43
        Originally posted by Moscow Mule View Post
        All you chaps with your new fangled languages (C ? wtf is that?) should try decyphering RPG2 without comments.

        It's a complete cluster****.
        I nearly did an RPG course when I left the Air Force. Glad I didn't...
        Older and ...well, just older!!

        Comment


          #44
          One client used CheckStyle to ensure the code was 'compliant' with its coding standards before you could commit to CVS. The other devs would faithfully write out long useless comments, but I just did this:


          /**
          * Accessor method.
          */
          public String getPostcode() {
          Cats are evil.

          Comment


            #45
            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...?!
            What is a unit test?

            Is that like compliation?

            Comment


              #46
              XML comments in .NET are useful for generating documentation using NDoc and for intellisense in the IDE, so they are a good idea.

              But rather than write comments in the body of the code, why not spend the time saved writing comprehensive unit tests and robust error handling instead?

              Far more useful than comments.

              Comment


                #47
                Originally posted by ratewhore View Post
                Bless. This is general, you have to take the rough with the smooth...


                totally inane and stupid

                HTH

                Comment


                  #48
                  Originally posted by Ruprect View Post
                  If you're writing a class that long you need to be shot.
                  The program in question was written long before classes were thought of. Please pay attention at the back.
                  Down with racism. Long live miscegenation!

                  Comment


                    #49
                    Originally posted by DimPrawn View Post
                    XML comments in .NET are useful for generating documentation using NDoc and for intellisense in the IDE, so they are a good idea.
                    Funny you say that, because the C# project I've inherited has some comments like that, and as you say it's useful for tooltips and the like in the IDE if nothing else. But it doesn't agree with the code standard, so I'm having to change them to a format that doesn't work with the IDE.

                    One old project I work on has a fair amount of "TODO: Write the purpose of this function" comments, which come from VC++ I think. It also has several "Take this bodge out" comments - although I'm probably responsible for some of them.

                    The thing that annoys me the most is finding blocks of commented out code with no explanation as to why. Is it something essential that's been temporarily removed, or is it an experiement that didn't work? Who knows?
                    Will work inside IR35. Or for food.

                    Comment


                      #50
                      Originally posted by BrilloPad View Post
                      What is a unit test?

                      Is that like compliation?
                      Yes, spelt correctly.

                      The last thing testers need is bug-free software.
                      And what exactly is wrong with an "ad hominem" argument? Dodgy Agent, 16-5-2014

                      Comment

                      Working...
                      X