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. Useful Source Code Documentation

Useful Source Code Documentation

Scheduled Pinned Locked Moved The Lounge
csharpvisual-studiocomquestion
19 Posts 17 Posters 4 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.
  • J Jacquers

    I'm leaving my current employer and have been tasked with doing handover documentation for projects I've worked on. I have the /// style comments on my methods and could generate documentation using something like Doxygen. I'm just not sure that the kind of documentation generated by this is any more useful than looking at the code... ? What would actually be useful for someone to be able to get an understanding of the source code? Class diagrams maybe? Edit: These may be useful: [Visualize dependencies with code maps - Visual Studio (Windows) | Microsoft Docs](https://docs.microsoft.com/en-us/visualstudio/modeling/map-dependencies-across-your-solutions?view=vs-2022) [Quick Diagram Tool for C# - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=FerencVizkeleti.QuickDiagramToolforC)

    F Offline
    F Offline
    Forogar
    wrote on last edited by
    #7

    Documentation of "what" (such as that generated by Doxygen) is happening is not always that useful. I find an explanation of "why" is much more helpful. Unfortunately there is no tool that can do that for you.

    - I would love to change the world, but they won’t give me the source code.

    1 Reply Last reply
    0
    • J Jacquers

      I'm leaving my current employer and have been tasked with doing handover documentation for projects I've worked on. I have the /// style comments on my methods and could generate documentation using something like Doxygen. I'm just not sure that the kind of documentation generated by this is any more useful than looking at the code... ? What would actually be useful for someone to be able to get an understanding of the source code? Class diagrams maybe? Edit: These may be useful: [Visualize dependencies with code maps - Visual Studio (Windows) | Microsoft Docs](https://docs.microsoft.com/en-us/visualstudio/modeling/map-dependencies-across-your-solutions?view=vs-2022) [Quick Diagram Tool for C# - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=FerencVizkeleti.QuickDiagramToolforC)

      C Offline
      C Offline
      Craig Robbins
      wrote on last edited by
      #8

      Best documentation I see explains "Why?" Ask why the code exists, and sometimes for why the design was used vs other alternatives. The level of explanation depends on the complexity of the project.

      Greg UtasG 1 Reply Last reply
      0
      • H honey the codewitch

        I write technical articles on using my code, with code examples. On top of that, I often generate reference docs using a tool like doxygen. I find that creating a technical article not only makes it easier for people to get their feet under them using it (at least I think so), it also helps me later to flesh out an outline of the major components of the software, which then evolves into a table contents. Finally that becomes master documentation. Tools like Doxygen can only supplement. They don't generate useful enough documentation on their own, except maybe if you use all of the tags, like <example> which is at least as much work as doing the above I think. Edit: In practice, at least in my own experience, I find that class diagrams aren't very useful, UML can be especially for large systems, but the way it's used it often isn't.

        To err is human. Fortune favors the monsters.

        R Offline
        R Offline
        raddevus
        wrote on last edited by
        #9

        honey the codewitch wrote:

        I find that creating a technical article not only makes it easier for people to get their feet under them using it (at least I think so), it also helps me later to flesh out an outline of the major components of the software, which then evolves into a table contents. Finally that becomes master documentation.

        I agree 100%. I'm always interested in how to communicate technical details to an audience without confusing or boring them. What makes it better? Mostly, I mean shorter when I say better. After reading numerous brain books I discovered something that is interesting. Almost everything you know & think about has been learned through Context. The easiest example here is you need to remember a list of 15 things. If you simply attempt to remember them you will get 5 +/- 2. However, if you build a story around those 15 things it is quite likely you will remember them. Humans need context. And so it is with documentation (IMO). A lot of documentation is simply a list of technical details. However, if you provide Context -- think of communicating how the thing works as if it is a story to a listener who is somewhat interested. This does generally mean documentation is longer but if you do it right it will be so much better it will seem shorter (in most cases).

        J 1 Reply Last reply
        0
        • J Jacquers

          I'm leaving my current employer and have been tasked with doing handover documentation for projects I've worked on. I have the /// style comments on my methods and could generate documentation using something like Doxygen. I'm just not sure that the kind of documentation generated by this is any more useful than looking at the code... ? What would actually be useful for someone to be able to get an understanding of the source code? Class diagrams maybe? Edit: These may be useful: [Visualize dependencies with code maps - Visual Studio (Windows) | Microsoft Docs](https://docs.microsoft.com/en-us/visualstudio/modeling/map-dependencies-across-your-solutions?view=vs-2022) [Quick Diagram Tool for C# - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=FerencVizkeleti.QuickDiagramToolforC)

          Sander RosselS Offline
          Sander RosselS Offline
          Sander Rossel
          wrote on last edited by
          #10

          I'm in the situation now where I have to take over an array of projects without any help from the original programmer. Here's what I want to know: HOW DO I RUN THIS STUFF LOCALLY!? Any configuration I need to know about? Also, how do I deploy!? Do I have to copy some files, run database scripts, do a VS deploy, run a pipeline? When "the business" talks about an application, what Git repositories do I need? Also, are there any projects that should be changed together, which is not obvious from the code (for example, because they share a database dependency). I'm rarely interested in documentation about the code. I can read the code. I can click a button/call an endpoint and set a breakpoint to follow through the code. The things I want to know are the things I can't know without knowing (this sounds more profound than I had meant it to be :laugh: ).

          Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript

          J 1 Reply Last reply
          0
          • R raddevus

            honey the codewitch wrote:

            I find that creating a technical article not only makes it easier for people to get their feet under them using it (at least I think so), it also helps me later to flesh out an outline of the major components of the software, which then evolves into a table contents. Finally that becomes master documentation.

            I agree 100%. I'm always interested in how to communicate technical details to an audience without confusing or boring them. What makes it better? Mostly, I mean shorter when I say better. After reading numerous brain books I discovered something that is interesting. Almost everything you know & think about has been learned through Context. The easiest example here is you need to remember a list of 15 things. If you simply attempt to remember them you will get 5 +/- 2. However, if you build a story around those 15 things it is quite likely you will remember them. Humans need context. And so it is with documentation (IMO). A lot of documentation is simply a list of technical details. However, if you provide Context -- think of communicating how the thing works as if it is a story to a listener who is somewhat interested. This does generally mean documentation is longer but if you do it right it will be so much better it will seem shorter (in most cases).

            J Offline
            J Offline
            Jon McKee
            wrote on last edited by
            #11

            If you're talking about documentation similar to Mozilla's and Spring's then I'm 100% on board :thumbsup:

            1 Reply Last reply
            0
            • C Craig Robbins

              Best documentation I see explains "Why?" Ask why the code exists, and sometimes for why the design was used vs other alternatives. The level of explanation depends on the complexity of the project.

              Greg UtasG Offline
              Greg UtasG Offline
              Greg Utas
              wrote on last edited by
              #12

              The why often depends on how something fits into the bigger picture. The rationale can be anything from architectural to it had to be done this way to mesh with some PoS that we didn't have the time to rewrite. These things would usually be described in a the HLD, but the discipline to make those living documents is rare.

              Robust Services Core | Software Techniques for Lemmings | Articles
              The fox knows many things, but the hedgehog knows one big thing.

              <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
              <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

              1 Reply Last reply
              0
              • Sander RosselS Sander Rossel

                I'm in the situation now where I have to take over an array of projects without any help from the original programmer. Here's what I want to know: HOW DO I RUN THIS STUFF LOCALLY!? Any configuration I need to know about? Also, how do I deploy!? Do I have to copy some files, run database scripts, do a VS deploy, run a pipeline? When "the business" talks about an application, what Git repositories do I need? Also, are there any projects that should be changed together, which is not obvious from the code (for example, because they share a database dependency). I'm rarely interested in documentation about the code. I can read the code. I can click a button/call an endpoint and set a breakpoint to follow through the code. The things I want to know are the things I can't know without knowing (this sounds more profound than I had meant it to be :laugh: ).

                Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript

                J Offline
                J Offline
                Jacquers
                wrote on last edited by
                #13

                That I have documented for the most part on one of the projects so far :) We're putting some effort into documenting a lot of our processes and info now. Previously it had been in emails, some documents, etc. but now it's getting combined into Confluence. Finally... now that I'm leaving :laugh:

                1 Reply Last reply
                0
                • J Jacquers

                  I'm leaving my current employer and have been tasked with doing handover documentation for projects I've worked on. I have the /// style comments on my methods and could generate documentation using something like Doxygen. I'm just not sure that the kind of documentation generated by this is any more useful than looking at the code... ? What would actually be useful for someone to be able to get an understanding of the source code? Class diagrams maybe? Edit: These may be useful: [Visualize dependencies with code maps - Visual Studio (Windows) | Microsoft Docs](https://docs.microsoft.com/en-us/visualstudio/modeling/map-dependencies-across-your-solutions?view=vs-2022) [Quick Diagram Tool for C# - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=FerencVizkeleti.QuickDiagramToolforC)

                  W Offline
                  W Offline
                  Wizard of Sleeves
                  wrote on last edited by
                  #14

                  Pretentious: Good code doesn't need documenting, it is self explanatory. Reality: I am lazy In practice, I try to minimize in-code documentation to reduce clutter and limit it to "magic" code, where I have used an unconventional technique that might confuse a lesser mortal.

                  Nothing succeeds like a budgie without teeth. To err is human, to arr is pirate.

                  C 1 Reply Last reply
                  0
                  • W Wizard of Sleeves

                    Pretentious: Good code doesn't need documenting, it is self explanatory. Reality: I am lazy In practice, I try to minimize in-code documentation to reduce clutter and limit it to "magic" code, where I have used an unconventional technique that might confuse a lesser mortal.

                    Nothing succeeds like a budgie without teeth. To err is human, to arr is pirate.

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

                    absolutely agree. Suffering with this right now.

                    Charlie Gilley “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759 Has never been more appropriate.

                    1 Reply Last reply
                    0
                    • J Jacquers

                      I'm leaving my current employer and have been tasked with doing handover documentation for projects I've worked on. I have the /// style comments on my methods and could generate documentation using something like Doxygen. I'm just not sure that the kind of documentation generated by this is any more useful than looking at the code... ? What would actually be useful for someone to be able to get an understanding of the source code? Class diagrams maybe? Edit: These may be useful: [Visualize dependencies with code maps - Visual Studio (Windows) | Microsoft Docs](https://docs.microsoft.com/en-us/visualstudio/modeling/map-dependencies-across-your-solutions?view=vs-2022) [Quick Diagram Tool for C# - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=FerencVizkeleti.QuickDiagramToolforC)

                      G Offline
                      G Offline
                      GuyThiebaut
                      wrote on last edited by
                      #16

                      I think it's more your "experience" knowledge that will be useful for the next person - so I would argue that a document explaining the domain knowledge and why certain APIs and code work they way they do may be of far more use than code documentation. I say this because I spend a lot of time reading code and the most useful information I get from other developers is information like "yeah, this is what can go wrong and this is how the customer uses the API".

                      “That which can be asserted without evidence, can be dismissed without evidence.”

                      ― Christopher Hitchens

                      1 Reply Last reply
                      0
                      • J Jacquers

                        I'm leaving my current employer and have been tasked with doing handover documentation for projects I've worked on. I have the /// style comments on my methods and could generate documentation using something like Doxygen. I'm just not sure that the kind of documentation generated by this is any more useful than looking at the code... ? What would actually be useful for someone to be able to get an understanding of the source code? Class diagrams maybe? Edit: These may be useful: [Visualize dependencies with code maps - Visual Studio (Windows) | Microsoft Docs](https://docs.microsoft.com/en-us/visualstudio/modeling/map-dependencies-across-your-solutions?view=vs-2022) [Quick Diagram Tool for C# - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=FerencVizkeleti.QuickDiagramToolforC)

                        K Offline
                        K Offline
                        Kirk 10389821
                        wrote on last edited by
                        #17

                        You asked for advice and are getting a whole range from a diverse set of viewpoints! I will say that some of the most important things to document are: 1) Dependencies/Build/install/setup 2) Validation. How do you test/validate (or who else is responsible). Built in Testing? 3) Deployment Guidelines 4) Risks, Previous issues, and the most problematic code 5) The overall architecture, and a "Metaphor" for how to view the system 6) Any indication of how they might locate something (or the logic of the structure choosen) Look at it this way. Assume YOU were walking in on day 1. The new developer to replace the previous. You have NO CLUE what this system does. How to build it or test it. If you are even using the latest source. Your confidence is in the toilet, and they need you to get up to speed. What type of information would increase your confidence, and get you able to BUILD and VALIDATE the build the quickest? Then what information would allow you to NAVIGATE the code logically? Finally, assuming you only fixed a Typo... On your first day. What would make you feel okay to publish that change??? Document those things. NOT the code, per se. IMHO

                        1 Reply Last reply
                        0
                        • J Jacquers

                          I'm leaving my current employer and have been tasked with doing handover documentation for projects I've worked on. I have the /// style comments on my methods and could generate documentation using something like Doxygen. I'm just not sure that the kind of documentation generated by this is any more useful than looking at the code... ? What would actually be useful for someone to be able to get an understanding of the source code? Class diagrams maybe? Edit: These may be useful: [Visualize dependencies with code maps - Visual Studio (Windows) | Microsoft Docs](https://docs.microsoft.com/en-us/visualstudio/modeling/map-dependencies-across-your-solutions?view=vs-2022) [Quick Diagram Tool for C# - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=FerencVizkeleti.QuickDiagramToolforC)

                          J Offline
                          J Offline
                          JP Reyes
                          wrote on last edited by
                          #18

                          Sometimes the best coding dramas are written in the comments. (aside from some funny jokes) But sometimes a good laugh is the best way to make people remember the oddities of certain hacks or unusual algorithms. If I ever see Windows ME's source code, I'd expect to see shitfaced comments all over the people (evidence of Balmer's Peak)

                          1 Reply Last reply
                          0
                          • J Jacquers

                            I'm leaving my current employer and have been tasked with doing handover documentation for projects I've worked on. I have the /// style comments on my methods and could generate documentation using something like Doxygen. I'm just not sure that the kind of documentation generated by this is any more useful than looking at the code... ? What would actually be useful for someone to be able to get an understanding of the source code? Class diagrams maybe? Edit: These may be useful: [Visualize dependencies with code maps - Visual Studio (Windows) | Microsoft Docs](https://docs.microsoft.com/en-us/visualstudio/modeling/map-dependencies-across-your-solutions?view=vs-2022) [Quick Diagram Tool for C# - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=FerencVizkeleti.QuickDiagramToolforC)

                            C Offline
                            C Offline
                            Caslen
                            wrote on last edited by
                            #19

                            Comments are often restricted to what the code does, this is only half the story. It arguably more useful to know why its been written or why it's been written a particular way, this can't always be inferred from the code itself.

                            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