Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

18
  • 9
    Best of both worlds is a short comment describing the issue and the issue number with the full story. Commented Feb 6, 2020 at 0:19
  • 17
    @Qwertie That however is also worst of all things: it goes outdated very fast and the link between "where in the story" and "what comment refers to this" is quickly breaking. Commented Feb 6, 2020 at 2:57
  • 10
    @paul23 That has not been my experience. I find that the ticket numbers have helped me the most on very old and obscure bits of code that no one can remember exactly what they were for and a comment with a ticket number takes me to the full discussion for how the feature should work and what the purpose was. Commented Feb 6, 2020 at 3:23
  • 44
    Putting ticket numbers in source code works up until the point that the business decides to switch bug tracking systems. I can't even tell you how many times in my career I've come across comments saying "See bug XYZ" for a bug tracking system that had gone out of use years ago. Put the information in the comments - one less level of indirection for reader to deal with and no risk of the information disappearing. Commented Feb 6, 2020 at 17:20
  • 7
    @paul23 because we don't have time to always do that... Of course you do. You might as well say you don't have time to check the files back into version control, or run the compiler. It's part of the job. You can choose to do a half-assed job if you want, but it's disingenuous to complain that you've got half-assed results when you do a half-assed job. Of course you have. If you leave the comments out then the half-assed nature of the job may only be noticed when the code is found to be unmaintainable because no-one can figure it out, but it doesn't change that it's a half-assed job. Commented Feb 6, 2020 at 17:35