问题
I know that they provide a quick reference, but as the code grows they can lead to hundreds of files changing just due to version/history updates.
This leads/relates to my other question: Is there a way to prevent code comments to be marked as changes in the diffs obtained from version control? (CVS/SVN)
回答1:
Keep the version/history info in the version control. That's what it's good at.
Version/history info in the source file is only useful for people that read the source code without having access to your version control repository. How likely and how important is that scenario, to justify the effort you will require from your team to maintain these notes? My personal opinion is that this would add a lot of additional work for fringe benefits.
回答2:
I agree with @Franci Penov. Here's a slightly different perspective:
- In the best case, they are useless, because they just duplicate information that is readily available, always automatically up-to-date, and much easier accessible in the version control system.
- In all other cases, they range from distracting over annoying to outright misleading (if they go out of sync with the version control system).
来源:https://stackoverflow.com/questions/4128913/is-it-useful-to-have-versioning-information-like-history-log-and-file-id-on-the