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. Do you add change history in source code? why?

Do you add change history in source code? why?

Scheduled Pinned Locked Moved The Lounge
questioncollaborationhelp
34 Posts 20 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
    CooperWu
    wrote on last edited by
    #1

    Our team add change history in source code all the time, and in my opinion it is NOT necessary. Because all source code are controlled by VSS. and we will write message while check in. So my question is, do you add change history in source code? what's reason add or not add? e.g int i = j + m; changes to: // modified by XXX at ??? for bug#xxxx(begin) // int i = j + m; int i = j + m + 1; // modified by XXX at ??? for bug#xxxx(end) ...

    B P A S C 13 Replies Last reply
    0
    • C CooperWu

      Our team add change history in source code all the time, and in my opinion it is NOT necessary. Because all source code are controlled by VSS. and we will write message while check in. So my question is, do you add change history in source code? what's reason add or not add? e.g int i = j + m; changes to: // modified by XXX at ??? for bug#xxxx(begin) // int i = j + m; int i = j + m + 1; // modified by XXX at ??? for bug#xxxx(end) ...

      B Offline
      B Offline
      Bassam Abdul Baki
      wrote on last edited by
      #2

      Per bug fix no, but if the code changes to implement a new functionality, yes.


      "I know which side I want to win regardless of how many wrongs they have to commit to achieve it." - Stan Shannon Web - Blog - RSS - Math - LinkedIn - BM

      1 Reply Last reply
      0
      • C CooperWu

        Our team add change history in source code all the time, and in my opinion it is NOT necessary. Because all source code are controlled by VSS. and we will write message while check in. So my question is, do you add change history in source code? what's reason add or not add? e.g int i = j + m; changes to: // modified by XXX at ??? for bug#xxxx(begin) // int i = j + m; int i = j + m + 1; // modified by XXX at ??? for bug#xxxx(end) ...

        P Offline
        P Offline
        PIEBALDconsult
        wrote on last edited by
        #3

        It indicates exactly what was changed where. And it's good practice for when you have a different job without source control.

        L 1 Reply Last reply
        0
        • C CooperWu

          Our team add change history in source code all the time, and in my opinion it is NOT necessary. Because all source code are controlled by VSS. and we will write message while check in. So my question is, do you add change history in source code? what's reason add or not add? e.g int i = j + m; changes to: // modified by XXX at ??? for bug#xxxx(begin) // int i = j + m; int i = j + m + 1; // modified by XXX at ??? for bug#xxxx(end) ...

          A Offline
          A Offline
          Andy Brummer
          wrote on last edited by
          #4

          No, because we have source control. I keep comments updated with why the code is written like it is. If it makes sense, I include the information about the bug if it makes the code easier to understand.


          I can imagine the sinking feeling one would have after ordering my book, only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon

          1 Reply Last reply
          0
          • C CooperWu

            Our team add change history in source code all the time, and in my opinion it is NOT necessary. Because all source code are controlled by VSS. and we will write message while check in. So my question is, do you add change history in source code? what's reason add or not add? e.g int i = j + m; changes to: // modified by XXX at ??? for bug#xxxx(begin) // int i = j + m; int i = j + m + 1; // modified by XXX at ??? for bug#xxxx(end) ...

            S Offline
            S Offline
            Shog9 0
            wrote on last edited by
            #5

            I detest those sorts of comments. They make the code unreadable very quickly. We do keep a brief change log in function header comments. It's convenient when you want to know who last modified it and why, and provides a bit of safety should something happen to source control.

            ----

            I don't care what you consider witty, but at least I do not blather on posting nonsense like Jim Crafton.

            -- Stringcheese, humbled by Crafton's ability to string together multiple sentences

            1 Reply Last reply
            0
            • C CooperWu

              Our team add change history in source code all the time, and in my opinion it is NOT necessary. Because all source code are controlled by VSS. and we will write message while check in. So my question is, do you add change history in source code? what's reason add or not add? e.g int i = j + m; changes to: // modified by XXX at ??? for bug#xxxx(begin) // int i = j + m; int i = j + m + 1; // modified by XXX at ??? for bug#xxxx(end) ...

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              It depends. If I find I have to change existing code, I try to write it so that new functionality is exposed, but the default behaviour does not change. If I can't do that, or if I think I've found a bug, but I'm not 100% sure, or for a variety of other reasons, I would totally leave a comment to say what I changed and why, in case someone else comes back to the code and wonders why it's not what they expected, or in case I need to change it back, or come up with a new implimentation that sometimes works the old way. So, I would intelligently decide to leave such comments where it's warranted. I would never be in favour of a policy that involves doing this all the time.

              Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

              1 Reply Last reply
              0
              • C CooperWu

                Our team add change history in source code all the time, and in my opinion it is NOT necessary. Because all source code are controlled by VSS. and we will write message while check in. So my question is, do you add change history in source code? what's reason add or not add? e.g int i = j + m; changes to: // modified by XXX at ??? for bug#xxxx(begin) // int i = j + m; int i = j + m + 1; // modified by XXX at ??? for bug#xxxx(end) ...

                _ Offline
                _ Offline
                _Damian S_
                wrote on last edited by
                #7

                Yep, I initial and datestamp my changes in code almost all the time... After a while, (ie: once the changes have become obsolete due to further enhancements etc) I clear out the irrelevant comments while making said changes... Not only has this saved me a few times (someone broke this - is it initialed? No? Not me then!), but makes it easy to find all changes I have made by searching on my initials. Ultimately, pick a way you want to do it and do it consistently!

                ------------------------------------------- Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Just bugger off and leave me alone!!

                B 1 Reply Last reply
                0
                • P PIEBALDconsult

                  It indicates exactly what was changed where. And it's good practice for when you have a different job without source control.

                  L Offline
                  L Offline
                  Luis Alonso Ramos
                  wrote on last edited by
                  #8

                  PIEBALDconsult wrote:

                  when you have a different job without source control

                  If I have a different job without source control, I'll make sure we start using. It is such a useful and required tool!

                  Luis Alonso Ramos Intelectix Chihuahua, Mexico

                  My Blog!

                  M 1 Reply Last reply
                  0
                  • C CooperWu

                    Our team add change history in source code all the time, and in my opinion it is NOT necessary. Because all source code are controlled by VSS. and we will write message while check in. So my question is, do you add change history in source code? what's reason add or not add? e.g int i = j + m; changes to: // modified by XXX at ??? for bug#xxxx(begin) // int i = j + m; int i = j + m + 1; // modified by XXX at ??? for bug#xxxx(end) ...

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    Thats horrible. We use a combination of subversion, trac and some open source wiki. If people use them correctly we can open a trac ticket and see a diff of the changes made to resolve it in the wiki. We also use the "blame" feature of subversion/tortise.

                    M 1 Reply Last reply
                    0
                    • C CooperWu

                      Our team add change history in source code all the time, and in my opinion it is NOT necessary. Because all source code are controlled by VSS. and we will write message while check in. So my question is, do you add change history in source code? what's reason add or not add? e.g int i = j + m; changes to: // modified by XXX at ??? for bug#xxxx(begin) // int i = j + m; int i = j + m + 1; // modified by XXX at ??? for bug#xxxx(end) ...

                      P Offline
                      P Offline
                      Paul Conrad
                      wrote on last edited by
                      #10

                      Sometimes I do and sometimes I don't. Depends on the project and how much it's worth to me :->

                      "Try asking what you want to know, rather than asking a question whose answer you know." - Christian Graus

                      1 Reply Last reply
                      0
                      • C CooperWu

                        Our team add change history in source code all the time, and in my opinion it is NOT necessary. Because all source code are controlled by VSS. and we will write message while check in. So my question is, do you add change history in source code? what's reason add or not add? e.g int i = j + m; changes to: // modified by XXX at ??? for bug#xxxx(begin) // int i = j + m; int i = j + m + 1; // modified by XXX at ??? for bug#xxxx(end) ...

                        M Offline
                        M Offline
                        Member 96
                        wrote on last edited by
                        #11

                        We don't use VSS or any code repository and we *do* often keep a change history for anything that is complex or interesting. However if we did use a code repository (and I really see it as being more trouble than it could ever be worth in a small shop) I would still insist on the change history in comments because it would sure be a pain in the ass to not have that info right in front of you at all times. Comments cost nothing in the long run, as long as they are relevant they should always be front and center at all times.


                        Never trust machinery more complicated than a knife and fork. - Jubal Harshaw in Stranger in a Strange Land

                        _ S J 3 Replies Last reply
                        0
                        • L Luis Alonso Ramos

                          PIEBALDconsult wrote:

                          when you have a different job without source control

                          If I have a different job without source control, I'll make sure we start using. It is such a useful and required tool!

                          Luis Alonso Ramos Intelectix Chihuahua, Mexico

                          My Blog!

                          M Offline
                          M Offline
                          Member 96
                          wrote on last edited by
                          #12

                          I disagree entirely unless you're in a big shop. From everything I've ever seen on the subject it seems dangerous, fragile and adds an unnecessary level of complexity. Dangerous because it seems to foster a culture of not backing up properly and often. Fragile because they always seem to be breaking down or mangling code judging by the comments here and unnecessarily complex because well, it just is. For a very large shop with many programmers I can see the value, but let's face it, most of this stuff foisted on us is designed for factory code development, not for small versatile crafted code development.


                          Never trust machinery more complicated than a knife and fork. - Jubal Harshaw in Stranger in a Strange Land

                          _ K L S J 6 Replies Last reply
                          0
                          • M Member 96

                            I disagree entirely unless you're in a big shop. From everything I've ever seen on the subject it seems dangerous, fragile and adds an unnecessary level of complexity. Dangerous because it seems to foster a culture of not backing up properly and often. Fragile because they always seem to be breaking down or mangling code judging by the comments here and unnecessarily complex because well, it just is. For a very large shop with many programmers I can see the value, but let's face it, most of this stuff foisted on us is designed for factory code development, not for small versatile crafted code development.


                            Never trust machinery more complicated than a knife and fork. - Jubal Harshaw in Stranger in a Strange Land

                            _ Offline
                            _ Offline
                            _Damian S_
                            wrote on last edited by
                            #13

                            Couldn't agree more - I don't use an automated source code control at home (Visual SourceSafe etc) - only when onsite with larger clients.

                            ------------------------------------------- Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Just bugger off and leave me alone!!

                            1 Reply Last reply
                            0
                            • M Member 96

                              We don't use VSS or any code repository and we *do* often keep a change history for anything that is complex or interesting. However if we did use a code repository (and I really see it as being more trouble than it could ever be worth in a small shop) I would still insist on the change history in comments because it would sure be a pain in the ass to not have that info right in front of you at all times. Comments cost nothing in the long run, as long as they are relevant they should always be front and center at all times.


                              Never trust machinery more complicated than a knife and fork. - Jubal Harshaw in Stranger in a Strange Land

                              _ Offline
                              _ Offline
                              _Damian S_
                              wrote on last edited by
                              #14

                              Man, I am caning you with 5's at the moment... Couldn't agree more with this one either!!

                              ------------------------------------------- Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Just bugger off and leave me alone!!

                              1 Reply Last reply
                              0
                              • C CooperWu

                                Our team add change history in source code all the time, and in my opinion it is NOT necessary. Because all source code are controlled by VSS. and we will write message while check in. So my question is, do you add change history in source code? what's reason add or not add? e.g int i = j + m; changes to: // modified by XXX at ??? for bug#xxxx(begin) // int i = j + m; int i = j + m + 1; // modified by XXX at ??? for bug#xxxx(end) ...

                                M Offline
                                M Offline
                                malharone
                                wrote on last edited by
                                #15

                                Yes and no. We use TFS's attach work-item feature so that we don't have to manually enter this information everytime. But this approach is more time consuming than what we'd been doing for years. anyways, I've gotten in the habit of doing both and so far it has worked out well.

                                1 Reply Last reply
                                0
                                • L Lost User

                                  Thats horrible. We use a combination of subversion, trac and some open source wiki. If people use them correctly we can open a trac ticket and see a diff of the changes made to resolve it in the wiki. We also use the "blame" feature of subversion/tortise.

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

                                  more details please thanks Martin

                                  life is a bowl of cherries go on take a byte

                                  1 Reply Last reply
                                  0
                                  • M Member 96

                                    I disagree entirely unless you're in a big shop. From everything I've ever seen on the subject it seems dangerous, fragile and adds an unnecessary level of complexity. Dangerous because it seems to foster a culture of not backing up properly and often. Fragile because they always seem to be breaking down or mangling code judging by the comments here and unnecessarily complex because well, it just is. For a very large shop with many programmers I can see the value, but let's face it, most of this stuff foisted on us is designed for factory code development, not for small versatile crafted code development.


                                    Never trust machinery more complicated than a knife and fork. - Jubal Harshaw in Stranger in a Strange Land

                                    K Offline
                                    K Offline
                                    KaRl
                                    wrote on last edited by
                                    #17

                                    I strongly disagree. Source is the product, the most important thing we do. Once gone it is forever. Using a source control like tortoise/subversion is easy, and every programmer with more than 3 neurons (ok, it excludes VB users) should be able to use it.


                                    There are two things that one must get used to or one will find life unendurable: the damages of time and injustices of men Fold with us! ยค flickr

                                    M B 2 Replies Last reply
                                    0
                                    • C CooperWu

                                      Our team add change history in source code all the time, and in my opinion it is NOT necessary. Because all source code are controlled by VSS. and we will write message while check in. So my question is, do you add change history in source code? what's reason add or not add? e.g int i = j + m; changes to: // modified by XXX at ??? for bug#xxxx(begin) // int i = j + m; int i = j + m + 1; // modified by XXX at ??? for bug#xxxx(end) ...

                                      D Offline
                                      D Offline
                                      Duncan Edwards Jones
                                      wrote on last edited by
                                      #18

                                      No - never comment out code. The rule is no code should get into the application source without going through a human brain first. The two ways this can occur is : copy+paste or uncomment commented out code. Use a differential version control system if you want to know what the code used to be.

                                      '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd

                                      1 Reply Last reply
                                      0
                                      • C CooperWu

                                        Our team add change history in source code all the time, and in my opinion it is NOT necessary. Because all source code are controlled by VSS. and we will write message while check in. So my question is, do you add change history in source code? what's reason add or not add? e.g int i = j + m; changes to: // modified by XXX at ??? for bug#xxxx(begin) // int i = j + m; int i = j + m + 1; // modified by XXX at ??? for bug#xxxx(end) ...

                                        B Offline
                                        B Offline
                                        benjymous
                                        wrote on last edited by
                                        #19

                                        We tend to archive old obsolete projects (i.e. remove them from source control, and just leave the code tree read-only on a server somewhere) - every so often we might think "hey, this new bug sounds just like an old bug we fixed in xyz", when you haven't got checkin comments any more, it can be a major pain to find the bit of code that's relevant

                                        -- Help me! I'm turning into a grapefruit! Buzzwords!

                                        1 Reply Last reply
                                        0
                                        • _ _Damian S_

                                          Yep, I initial and datestamp my changes in code almost all the time... After a while, (ie: once the changes have become obsolete due to further enhancements etc) I clear out the irrelevant comments while making said changes... Not only has this saved me a few times (someone broke this - is it initialed? No? Not me then!), but makes it easy to find all changes I have made by searching on my initials. Ultimately, pick a way you want to do it and do it consistently!

                                          ------------------------------------------- Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Just bugger off and leave me alone!!

                                          B Offline
                                          B Offline
                                          Big Daddy Farang
                                          wrote on last edited by
                                          #20

                                          You hit the nail directly on the head! That's just what I do (except the datestamp only sometimes.) Five from me. BDF

                                          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