Is it useful to have versioning information like history log and file ID on the source file?

送分小仙女□ 提交于 2020-01-15 03:29:08

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!