Do you add change history in source code? why?
-
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)
... -
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)
... -
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)
...It indicates exactly what was changed where. And it's good practice for when you have a different job without source control.
-
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)
...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
-
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)
...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
-
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)
...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 )
-
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)
...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!!
-
It indicates exactly what was changed where. And it's good practice for when you have a different job without source control.
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
-
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)
...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.
-
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)
...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
-
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)
...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
-
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
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
-
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
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!!
-
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
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!!
-
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)
...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.
-
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.
more details please thanks Martin
life is a bowl of cherries go on take a byte
-
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
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
-
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)
...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
-
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)
...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!
-
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!!
You hit the nail directly on the head! That's just what I do (except the datestamp only sometimes.) Five from me. BDF