Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Interesting code comments

Interesting code comments

Scheduled Pinned Locked Moved The Lounge
comgame-devdata-structurestoolsperformance
35 Posts 28 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Vikram A Punathambekar

    LBW needs 2.5 pages to be explained? :confused: Bounced in line, hit in line; bounced outside of off, hit in line; bounced outside of off, hit outside of off; everything else - shouldn't take more than a few [pun unintended] lines.

    Cheers, Vikram. (Cracked not one CCC, but two!)

    S Offline
    S Offline
    S Senthil Kumar
    wrote on last edited by
    #13

    Hits the pad on the full? Inside edge? Ball landing outside leg stump? Batsman offering no shot? Switch hit? I can easily see it running to 2.5 pages.

    Regards Senthil _____________________________ My Home Page |My Blog | My Articles | My Flickr | WinMacro

    V 1 Reply Last reply
    0
    • V Vikram A Punathambekar

      LBW needs 2.5 pages to be explained? :confused: Bounced in line, hit in line; bounced outside of off, hit in line; bounced outside of off, hit outside of off; everything else - shouldn't take more than a few [pun unintended] lines.

      Cheers, Vikram. (Cracked not one CCC, but two!)

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #14

      I guess all started from explaining what is leg.

      50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!

      1 Reply Last reply
      0
      • 0 0x3c0

        Have you ever looked back through your code and seen some really odd or funny comments? I've coded while extremely tired two or three times, and when I looked at what I wrote in the morning, I laughed out loud. For example:

        //Found in a process identification method which used an array:
        //Process, I am your father. Search your table, you know it to be true

        //Found when rewriting a virtual memory manager:
        //May illusions reign once more

        //Hangman game, when there are no more tries left:
        //Kill him and dump the body outside town

        OSDev :)

        C Offline
        C Offline
        Cameron_DeW
        wrote on last edited by
        #15

        This guys website has some interesting comments in the HTML http://www.joshhubi.com/[^]

        1 Reply Last reply
        0
        • 0 0x3c0

          Have you ever looked back through your code and seen some really odd or funny comments? I've coded while extremely tired two or three times, and when I looked at what I wrote in the morning, I laughed out loud. For example:

          //Found in a process identification method which used an array:
          //Process, I am your father. Search your table, you know it to be true

          //Found when rewriting a virtual memory manager:
          //May illusions reign once more

          //Hangman game, when there are no more tries left:
          //Kill him and dump the body outside town

          OSDev :)

          M Offline
          M Offline
          ManicQin
          wrote on last edited by
          #16

          I once had the next comment

          //I HATE HIM
          //I HATE HIM
          //I HATE HIM
          //I HATE HIM

          1 Reply Last reply
          0
          • K Kyudos

            Ha ha! Reminds me of a story from my school days. We had one English teacher we were sure never read our work, and just marked it based on who we were...the "good" students got good grades etc. So one guy eventually decided to test our theory by writing incongruous garbage mid-sentence. I don't remember what the exercise was, but he'd written stuff along the lines of "and the story is advanced by the cross-over between the cat sat on the mat theme and character" and numerous other such stupidities. Sure enough, she gave lots of red ticks and his "usual" mark.

            S Offline
            S Offline
            SachinBhave
            wrote on last edited by
            #17

            Something similar happened in our school too....one of our teachers never used to read the answers in tests. There was a popular belief that she gave marks based on length of the answer. To prove this point one of the students actually wrote same line some 10-15 times, and to our surprise was awarded full marks.... :laugh:

            1 Reply Last reply
            0
            • R Roger Wright

              :laugh: Some things never change, and people still don't read. When I worked for a large aerospace contractor thirty years ago, we shipped missile systems with maintenance documents that were hundreds of pages thick, printed on 'D' or 'E' size paper in blueprint form. There were no large-format laser printers then, nor any electronic documents. One engineer I worked with was certain that no one ever actually read the documents we wrote, and to prove it, he slipped 2 sheets of typed jokes into one of the manuals. The document went through the Navy review process, was approved, and deployed along with the rest of the missile system. In the five years I worked there, no word of its discovery ever reached me, and to the best of my knowledge, no one yet has ever found those jokes. :-D

              "A Journey of a Thousand Rest Stops Begins with a Single Movement"

              D Offline
              D Offline
              Divya Rathore
              wrote on last edited by
              #18

              Did the Pilots ever report back to the base? Maybe weapons of mass destructions weren't there, and then maybe Bush ain't a bad guy either ;P

              D 1 Reply Last reply
              0
              • D Divya Rathore

                Did the Pilots ever report back to the base? Maybe weapons of mass destructions weren't there, and then maybe Bush ain't a bad guy either ;P

                D Offline
                D Offline
                dan sh
                wrote on last edited by
                #19

                Divya Rathore wrote:

                Bush ain't a bad guy either

                You have crossed almost all the levels of optimism.

                50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!

                1 Reply Last reply
                0
                • P Pete OHanlon

                  My favourite comment was from a developer I knew who thought that people never bothered to read comments at the start of methods. One comment explained the rules surrounding LBW (a cricket term meaning Leg Before Wicket). The comment ran to two and a half pages and, to my knowledge, is still there, still unacknowledged.

                  "WPF has many lovers. It's a veritable porn star!" - Josh Smith

                  As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

                  My blog | My articles | MoXAML PowerToys | Onyx

                  B Offline
                  B Offline
                  Brady Kelly
                  wrote on last edited by
                  #20

                  :laugh:

                  1 Reply Last reply
                  0
                  • R Roger Wright

                    :laugh: Some things never change, and people still don't read. When I worked for a large aerospace contractor thirty years ago, we shipped missile systems with maintenance documents that were hundreds of pages thick, printed on 'D' or 'E' size paper in blueprint form. There were no large-format laser printers then, nor any electronic documents. One engineer I worked with was certain that no one ever actually read the documents we wrote, and to prove it, he slipped 2 sheets of typed jokes into one of the manuals. The document went through the Navy review process, was approved, and deployed along with the rest of the missile system. In the five years I worked there, no word of its discovery ever reached me, and to the best of my knowledge, no one yet has ever found those jokes. :-D

                    "A Journey of a Thousand Rest Stops Begins with a Single Movement"

                    K Offline
                    K Offline
                    KungFuCoder
                    wrote on last edited by
                    #21

                    Not sure if this counts (and I'll ignore the marriage proposal printed across the middle of a 1000 page output nobody ever noticed) but when I was doing data analysis for a market research firm we had one job go horribly wrong and obviously going to miss its delivery deadline. The researcher in charge eventually psyched herself up to break the bad news to the client. His reply ? "Don't worry, we never read them anyway" His dept was tasked with getting reasearch done on the companys products so that's what he was doing.

                    1 Reply Last reply
                    0
                    • R Roger Wright

                      :laugh: Some things never change, and people still don't read. When I worked for a large aerospace contractor thirty years ago, we shipped missile systems with maintenance documents that were hundreds of pages thick, printed on 'D' or 'E' size paper in blueprint form. There were no large-format laser printers then, nor any electronic documents. One engineer I worked with was certain that no one ever actually read the documents we wrote, and to prove it, he slipped 2 sheets of typed jokes into one of the manuals. The document went through the Navy review process, was approved, and deployed along with the rest of the missile system. In the five years I worked there, no word of its discovery ever reached me, and to the best of my knowledge, no one yet has ever found those jokes. :-D

                      "A Journey of a Thousand Rest Stops Begins with a Single Movement"

                      V Offline
                      V Offline
                      Vincent Curry
                      wrote on last edited by
                      #22

                      Not quite the same sort of level, but I did something similar figuring that a boss of mine wouldn't read the documentation I wrote. Hence, in the FAQ I added a question about the effectiveness of the Crane Kick in Karate Kid. Sure enough, after "reviewing" my documentation he said it was OK...

                      Vincent www.pub-olympics.com

                      1 Reply Last reply
                      0
                      • 0 0x3c0

                        Have you ever looked back through your code and seen some really odd or funny comments? I've coded while extremely tired two or three times, and when I looked at what I wrote in the morning, I laughed out loud. For example:

                        //Found in a process identification method which used an array:
                        //Process, I am your father. Search your table, you know it to be true

                        //Found when rewriting a virtual memory manager:
                        //May illusions reign once more

                        //Hangman game, when there are no more tries left:
                        //Kill him and dump the body outside town

                        OSDev :)

                        G Offline
                        G Offline
                        Gary Wheeler
                        wrote on last edited by
                        #23

                        A comment from an enum declaration, intended for other folks in my group:

                        ErrorPsi\_OHIO\_INCORRECTINKWRN,                  // W – "Incorrect Ink Warning"
                        ErrorPsi\_OHIO\_INKEXPIRED,                       // W – "Ink Expired Warning"
                        \_ErrorPsi\_Marker                                **// INSERT NEW ERRORS ABOVE THIS VALUE;
                                                                        // DO NOT REMOVE THE MARKER,
                                                                        // LEST YE ANGER THE ELDER GODS**
                        

                        };

                        Software Zen: delete this;

                        1 Reply Last reply
                        0
                        • 0 0x3c0

                          Have you ever looked back through your code and seen some really odd or funny comments? I've coded while extremely tired two or three times, and when I looked at what I wrote in the morning, I laughed out loud. For example:

                          //Found in a process identification method which used an array:
                          //Process, I am your father. Search your table, you know it to be true

                          //Found when rewriting a virtual memory manager:
                          //May illusions reign once more

                          //Hangman game, when there are no more tries left:
                          //Kill him and dump the body outside town

                          OSDev :)

                          P Offline
                          P Offline
                          Patrik67
                          wrote on last edited by
                          #24

                          Working on huge labouring project a couple of the engineers had a little bet to see if 'fluffy bunnies' could make it into the final documentation. The snippet was inserted randomly into a design document and although it never made it through to an approved version the history list for the doc had the words 'remove fluffy bunnies from para 1.2.3.4' so I think that won the bet.

                          1 Reply Last reply
                          0
                          • K Kyudos

                            Ha ha! Reminds me of a story from my school days. We had one English teacher we were sure never read our work, and just marked it based on who we were...the "good" students got good grades etc. So one guy eventually decided to test our theory by writing incongruous garbage mid-sentence. I don't remember what the exercise was, but he'd written stuff along the lines of "and the story is advanced by the cross-over between the cat sat on the mat theme and character" and numerous other such stupidities. Sure enough, she gave lots of red ticks and his "usual" mark.

                            P Offline
                            P Offline
                            Paul Hooper
                            wrote on last edited by
                            #25

                            I went one better. I submitted the same paper 10 times in one year - changing only the cover page and the last page (where the teacher wrote the mark). I got the same mark 10 times for ten totally different topics. Just call it "code reuse".

                            Paul Hooper If you spend your whole life looking over your shoulder, they will get you from the front instead.

                            1 Reply Last reply
                            0
                            • R Roger Wright

                              :laugh: Some things never change, and people still don't read. When I worked for a large aerospace contractor thirty years ago, we shipped missile systems with maintenance documents that were hundreds of pages thick, printed on 'D' or 'E' size paper in blueprint form. There were no large-format laser printers then, nor any electronic documents. One engineer I worked with was certain that no one ever actually read the documents we wrote, and to prove it, he slipped 2 sheets of typed jokes into one of the manuals. The document went through the Navy review process, was approved, and deployed along with the rest of the missile system. In the five years I worked there, no word of its discovery ever reached me, and to the best of my knowledge, no one yet has ever found those jokes. :-D

                              "A Journey of a Thousand Rest Stops Begins with a Single Movement"

                              D Offline
                              D Offline
                              Dan Neely
                              wrote on last edited by
                              #26

                              Reading all the replies to your post makes me wonder what's wrong with my company. Stuff that goes into management review gets marked up enough that a I know large chunks of it are being read before getting signed off.

                              3x12=36 2x12=24 1x12=12 0x12=18

                              1 Reply Last reply
                              0
                              • 0 0x3c0

                                Have you ever looked back through your code and seen some really odd or funny comments? I've coded while extremely tired two or three times, and when I looked at what I wrote in the morning, I laughed out loud. For example:

                                //Found in a process identification method which used an array:
                                //Process, I am your father. Search your table, you know it to be true

                                //Found when rewriting a virtual memory manager:
                                //May illusions reign once more

                                //Hangman game, when there are no more tries left:
                                //Kill him and dump the body outside town

                                OSDev :)

                                J Offline
                                J Offline
                                justahack
                                wrote on last edited by
                                #27

                                StackOverflow has a thread talking about all kinds of different code comments. It's well worth a couple of minutes reading through some of them. :-D

                                1 Reply Last reply
                                0
                                • 0 0x3c0

                                  Have you ever looked back through your code and seen some really odd or funny comments? I've coded while extremely tired two or three times, and when I looked at what I wrote in the morning, I laughed out loud. For example:

                                  //Found in a process identification method which used an array:
                                  //Process, I am your father. Search your table, you know it to be true

                                  //Found when rewriting a virtual memory manager:
                                  //May illusions reign once more

                                  //Hangman game, when there are no more tries left:
                                  //Kill him and dump the body outside town

                                  OSDev :)

                                  B Offline
                                  B Offline
                                  BrainiacV
                                  wrote on last edited by
                                  #28

                                  The in the late 60's the source code for the Digital Equipment Corporation (DEC) Time Sharing System for the PDP-8 processor (TSS-8) occasionally drifted off into mock German. In the 90's I was doing maintenance programming on a POS (and I DON'T mean Point of Sale) system written by consultants (until management finally got wise that they were being taken for a ride and brought evelopment in-house) that seemed to delight in framing their comment blocks so they looked like bi-wing airplanes. That is, when they deigned to write comments. One routine I had to go through was completely alphabet soup. Parameters were A, B, C, D, E, F, G. No one comment in the whole function. And the first thing we were taught in maintaining the code, was that names mean nothing. Just because the subroutine is named "Print", does not mean it ever gets around to doing any. Sorry to drift off subject a bit.

                                  Psychosis at 10 Film at 11

                                  1 Reply Last reply
                                  0
                                  • S S Senthil Kumar

                                    Hits the pad on the full? Inside edge? Ball landing outside leg stump? Batsman offering no shot? Switch hit? I can easily see it running to 2.5 pages.

                                    Regards Senthil _____________________________ My Home Page |My Blog | My Articles | My Flickr | WinMacro

                                    V Offline
                                    V Offline
                                    Vikram A Punathambekar
                                    wrote on last edited by
                                    #29

                                    S. Senthil Kumar wrote:

                                    Hits the pad on the full?

                                    Irrelevant.

                                    S. Senthil Kumar wrote:

                                    Inside edge?

                                    Can be taken care of with a preamble, not specific to the four cases.

                                    S. Senthil Kumar wrote:

                                    Ball landing outside leg stump?

                                    Part of the 'everything else' case.

                                    S. Senthil Kumar wrote:

                                    Batsman offering no shot?

                                    Only matters when ball pitches outside off and hits outside off, so yeah, taken care of, just a sub-point.

                                    S. Senthil Kumar wrote:

                                    Switch hit?

                                    I believe the rules of cricket are silent on that. I stand by what I said, there is no way it needs 2.5 pages.

                                    Cheers, Vikram. (Got my troika of CCCs!)

                                    S 1 Reply Last reply
                                    0
                                    • K Kyudos

                                      Ha ha! Reminds me of a story from my school days. We had one English teacher we were sure never read our work, and just marked it based on who we were...the "good" students got good grades etc. So one guy eventually decided to test our theory by writing incongruous garbage mid-sentence. I don't remember what the exercise was, but he'd written stuff along the lines of "and the story is advanced by the cross-over between the cat sat on the mat theme and character" and numerous other such stupidities. Sure enough, she gave lots of red ticks and his "usual" mark.

                                      F Offline
                                      F Offline
                                      Fahad Sadah
                                      wrote on last edited by
                                      #30

                                      My english teacher last year was talking to me about an essay I handed her. She was saying that it was waay beyond my level, a great essay, and obviously plagiarised. I told her it was my own work, and she checked by searching google. She concluded that yes, it was mine, but it was a rubbish essay anyway, full of faults, worst she'd ever seen.

                                      1 Reply Last reply
                                      0
                                      • V Vikram A Punathambekar

                                        S. Senthil Kumar wrote:

                                        Hits the pad on the full?

                                        Irrelevant.

                                        S. Senthil Kumar wrote:

                                        Inside edge?

                                        Can be taken care of with a preamble, not specific to the four cases.

                                        S. Senthil Kumar wrote:

                                        Ball landing outside leg stump?

                                        Part of the 'everything else' case.

                                        S. Senthil Kumar wrote:

                                        Batsman offering no shot?

                                        Only matters when ball pitches outside off and hits outside off, so yeah, taken care of, just a sub-point.

                                        S. Senthil Kumar wrote:

                                        Switch hit?

                                        I believe the rules of cricket are silent on that. I stand by what I said, there is no way it needs 2.5 pages.

                                        Cheers, Vikram. (Got my troika of CCCs!)

                                        S Offline
                                        S Offline
                                        S Senthil Kumar
                                        wrote on last edited by
                                        #31

                                        Vikram A Punathambekar wrote:

                                        Irrelevant.

                                        Not really - when the ball hits the pad on the full, the umpire must assume that the ball would go straight on. This matters for spinners; the umpire should not assume that the ball would turn after pitching. If the ball hits the pad after pitching, the umpire must consider the degree of turn. I'd imagine there would also be rules about what exactly constitutes the "leg" part in LBW - thighpad, straps etc..

                                        Vikram A Punathambekar wrote:

                                        I stand by what I said, there is no way it needs 2.5 pages.

                                        http://en.wikipedia.org/wiki/Leg_before_[^]has a pretty long explanation of the rules. The Lord's[^] website states it much more tersely, though it would be hard to imagine a normal developer writing like that. And oh, both of them clearly mention the full toss impact use case - "irrespective of whether the ball might have pitched subsequently or not". I didn't know about this for a long time - I'd be furious at certain decisions, where it was clear that had the ball landed, it would have turned past the stumps.

                                        Regards Senthil _____________________________ My Home Page |My Blog | My Articles | My Flickr | WinMacro

                                        V 1 Reply Last reply
                                        0
                                        • 0 0x3c0

                                          Have you ever looked back through your code and seen some really odd or funny comments? I've coded while extremely tired two or three times, and when I looked at what I wrote in the morning, I laughed out loud. For example:

                                          //Found in a process identification method which used an array:
                                          //Process, I am your father. Search your table, you know it to be true

                                          //Found when rewriting a virtual memory manager:
                                          //May illusions reign once more

                                          //Hangman game, when there are no more tries left:
                                          //Kill him and dump the body outside town

                                          OSDev :)

                                          N Offline
                                          N Offline
                                          Norm Powroz
                                          wrote on last edited by
                                          #32

                                          I think one of the best collections of comments I ever saw was in the primary window management module for the Emacs text editor, as implemented on Multics. This was one of the hairiest pieces of code you could ever imagine, written completely in Lisp. It was tight, it worked, and remained fairly bug-free for years, as its original implementor was a genius. Anyway, the entire piece of code was commented in Latin, on the grounds that if you needed the comments to help you understand what was going on, then you didn't belong here, and should leave well enough alone. If you knew what you were doing, and could follow the code as if it were written in your birth language, then you didn't need the comments. For my self, I have always believed in the Golden Rule of programming -- "Comment unto others as you would have them comment unto you." Norm

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups