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. General Programming
  3. C#
  4. Is there a way to document overloaded methods

Is there a way to document overloaded methods

Scheduled Pinned Locked Moved C#
question
9 Posts 4 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.
  • C Offline
    C Offline
    Clive D Pottinger
    wrote on last edited by
    #1

    /// <summary>
    /// Great big long multiline explanation of foo()
    /// </summary>
    public void foo() {...}

    /// <summary>
    /// same great big long explanation again
    /// </summary>
    /// <parm name="x">Put a number here</param>
    public void foo(int x) {...}

    /// <summary>
    /// same great big long explanation yet again
    /// </summary>
    /// <parm name="x">Put a number here</param>
    /// <parm name="y">Put a second number here</param>
    public void foo(int x, int y) {...}
    ...

    There has to be a better way... anyone?

    Clive Pottinger Victoria, BC

    E S 2 Replies Last reply
    0
    • C Clive D Pottinger

      /// <summary>
      /// Great big long multiline explanation of foo()
      /// </summary>
      public void foo() {...}

      /// <summary>
      /// same great big long explanation again
      /// </summary>
      /// <parm name="x">Put a number here</param>
      public void foo(int x) {...}

      /// <summary>
      /// same great big long explanation yet again
      /// </summary>
      /// <parm name="x">Put a number here</param>
      /// <parm name="y">Put a second number here</param>
      public void foo(int x, int y) {...}
      ...

      There has to be a better way... anyone?

      Clive Pottinger Victoria, BC

      E Offline
      E Offline
      Ennis Ray Lynch Jr
      wrote on last edited by
      #2

      It shows up in intellisense. I suppose the only better way is to put it in the design document.

      Need a C# Consultant? I'm available.
      Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

      C 1 Reply Last reply
      0
      • C Clive D Pottinger

        /// <summary>
        /// Great big long multiline explanation of foo()
        /// </summary>
        public void foo() {...}

        /// <summary>
        /// same great big long explanation again
        /// </summary>
        /// <parm name="x">Put a number here</param>
        public void foo(int x) {...}

        /// <summary>
        /// same great big long explanation yet again
        /// </summary>
        /// <parm name="x">Put a number here</param>
        /// <parm name="y">Put a second number here</param>
        public void foo(int x, int y) {...}
        ...

        There has to be a better way... anyone?

        Clive Pottinger Victoria, BC

        S Offline
        S Offline
        Scott Dorman
        wrote on last edited by
        #3

        NDoc supports an "<overloads>" XML comment, but I'm not sure if SandCastle also supports it. There really isn't any other way currently.

        Scott Dorman

        Microsoft® MVP - Visual C# | MCPD President - Tampa Bay IASA Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai


        [Forum Guidelines][Articles][Blog]

        C 1 Reply Last reply
        0
        • E Ennis Ray Lynch Jr

          It shows up in intellisense. I suppose the only better way is to put it in the design document.

          Need a C# Consultant? I'm available.
          Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

          C Offline
          C Offline
          Clive D Pottinger
          wrote on last edited by
          #4

          Well, not only does the current method mean having the same description entered over and over, but it is also prone to errors. I have a number of these kind of functions where foo() and foo(int x) both end up calling foo(int x, int y). If I make a change to foo(int x, int y) and alter its documentation, I have to make sure that I go back and alter the documentation for the other two - which, sometimes I miss, or do incorrectly. I was hoping for something more along the lines of

          /// <summary>
          /// Great big long multiline explanation of foo()
          /// </summary>
          public void foo() {...}

          /// <summary autodoc=foo()/>
          /// <parm name="x">Put a number here</param>
          public void foo(int x) {...}

          /// <summary autodoc=foo()/>
          /// <parm name="x">Put a number here</param>
          /// <parm name="y">Put a second number here</param>
          public void foo(int x, int y) {...}
          ...

          Something that would save typing the same function description over and over. And while I'm in pie-in-the-sky-land,

          /// <summary autodoc=foo()>
          /// but, unlike foo(), this method does not accept negative values.
          /// </summary/>
          /// <parm name="x">Put a number here</param>
          /// <parm name="y">Put a second number here</param>
          public void goo(int x, int y) {...}
          ...

          Clive Pottinger Victoria, BC

          E V S 3 Replies Last reply
          0
          • C Clive D Pottinger

            Well, not only does the current method mean having the same description entered over and over, but it is also prone to errors. I have a number of these kind of functions where foo() and foo(int x) both end up calling foo(int x, int y). If I make a change to foo(int x, int y) and alter its documentation, I have to make sure that I go back and alter the documentation for the other two - which, sometimes I miss, or do incorrectly. I was hoping for something more along the lines of

            /// <summary>
            /// Great big long multiline explanation of foo()
            /// </summary>
            public void foo() {...}

            /// <summary autodoc=foo()/>
            /// <parm name="x">Put a number here</param>
            public void foo(int x) {...}

            /// <summary autodoc=foo()/>
            /// <parm name="x">Put a number here</param>
            /// <parm name="y">Put a second number here</param>
            public void foo(int x, int y) {...}
            ...

            Something that would save typing the same function description over and over. And while I'm in pie-in-the-sky-land,

            /// <summary autodoc=foo()>
            /// but, unlike foo(), this method does not accept negative values.
            /// </summary/>
            /// <parm name="x">Put a number here</param>
            /// <parm name="y">Put a second number here</param>
            public void goo(int x, int y) {...}
            ...

            Clive Pottinger Victoria, BC

            E Offline
            E Offline
            Ennis Ray Lynch Jr
            wrote on last edited by
            #5

            Updating documentation is an expensive and time consuming process. Considering the bad results I have seen from automated tools causing developers to use inferred documentation I am a big fan of the manual process. Also, in general, an overloaded method should do the same thing as all of the other methods but with different parameters. Causing special handling is asking for disaster.

            Need a C# Consultant? I'm available.
            Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

            1 Reply Last reply
            0
            • C Clive D Pottinger

              Well, not only does the current method mean having the same description entered over and over, but it is also prone to errors. I have a number of these kind of functions where foo() and foo(int x) both end up calling foo(int x, int y). If I make a change to foo(int x, int y) and alter its documentation, I have to make sure that I go back and alter the documentation for the other two - which, sometimes I miss, or do incorrectly. I was hoping for something more along the lines of

              /// <summary>
              /// Great big long multiline explanation of foo()
              /// </summary>
              public void foo() {...}

              /// <summary autodoc=foo()/>
              /// <parm name="x">Put a number here</param>
              public void foo(int x) {...}

              /// <summary autodoc=foo()/>
              /// <parm name="x">Put a number here</param>
              /// <parm name="y">Put a second number here</param>
              public void foo(int x, int y) {...}
              ...

              Something that would save typing the same function description over and over. And while I'm in pie-in-the-sky-land,

              /// <summary autodoc=foo()>
              /// but, unlike foo(), this method does not accept negative values.
              /// </summary/>
              /// <parm name="x">Put a number here</param>
              /// <parm name="y">Put a second number here</param>
              public void goo(int x, int y) {...}
              ...

              Clive Pottinger Victoria, BC

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

              I know this doesn't help you with the problem at hand, but I think you'll do just fine - you already use and think about documentation FAR more than most people I know. :)

              Cheers, Vikram.


              The hands that help are holier than the lips that pray.

              1 Reply Last reply
              0
              • C Clive D Pottinger

                Well, not only does the current method mean having the same description entered over and over, but it is also prone to errors. I have a number of these kind of functions where foo() and foo(int x) both end up calling foo(int x, int y). If I make a change to foo(int x, int y) and alter its documentation, I have to make sure that I go back and alter the documentation for the other two - which, sometimes I miss, or do incorrectly. I was hoping for something more along the lines of

                /// <summary>
                /// Great big long multiline explanation of foo()
                /// </summary>
                public void foo() {...}

                /// <summary autodoc=foo()/>
                /// <parm name="x">Put a number here</param>
                public void foo(int x) {...}

                /// <summary autodoc=foo()/>
                /// <parm name="x">Put a number here</param>
                /// <parm name="y">Put a second number here</param>
                public void foo(int x, int y) {...}
                ...

                Something that would save typing the same function description over and over. And while I'm in pie-in-the-sky-land,

                /// <summary autodoc=foo()>
                /// but, unlike foo(), this method does not accept negative values.
                /// </summary/>
                /// <parm name="x">Put a number here</param>
                /// <parm name="y">Put a second number here</param>
                public void goo(int x, int y) {...}
                ...

                Clive Pottinger Victoria, BC

                S Offline
                S Offline
                Scott Dorman
                wrote on last edited by
                #7

                You might want to look at the <include>[^] tag.

                Scott Dorman

                Microsoft® MVP - Visual C# | MCPD President - Tampa Bay IASA Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai


                [Forum Guidelines][Articles][Blog]

                1 Reply Last reply
                0
                • S Scott Dorman

                  NDoc supports an "<overloads>" XML comment, but I'm not sure if SandCastle also supports it. There really isn't any other way currently.

                  Scott Dorman

                  Microsoft® MVP - Visual C# | MCPD President - Tampa Bay IASA Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai


                  [Forum Guidelines][Articles][Blog]

                  C Offline
                  C Offline
                  Clive D Pottinger
                  wrote on last edited by
                  #8

                  Thanks, Scott. That looks pretty good. Unfortunately, it is not recognised by VS. I must say that I am surprised that this seems to have been overlooked when the XML documentation ability was being created. It seems (to me, at any rate) to be an obvious feature to be included - much more so than the <seealso> or <include> tags. But, I'm still hoping one you guru's out there knows a way...

                  Clive Pottinger Victoria, BC

                  S 1 Reply Last reply
                  0
                  • C Clive D Pottinger

                    Thanks, Scott. That looks pretty good. Unfortunately, it is not recognised by VS. I must say that I am surprised that this seems to have been overlooked when the XML documentation ability was being created. It seems (to me, at any rate) to be an obvious feature to be included - much more so than the <seealso> or <include> tags. But, I'm still hoping one you guru's out there knows a way...

                    Clive Pottinger Victoria, BC

                    S Offline
                    S Offline
                    Scott Dorman
                    wrote on last edited by
                    #9

                    cpotting wrote:

                    I must say that I am surprised that this seems to have been overlooked when the XML documentation ability was being created. It seems (to me, at any rate) to be an obvious feature to be included - much more so than the <seealso> or <include> tags.

                    I agree. You may want to check the Sandcastle documentation, as it may support the overloads tag.

                    Scott Dorman

                    Microsoft® MVP - Visual C# | MCPD President - Tampa Bay IASA Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai


                    [Forum Guidelines][Articles][Blog]

                    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