3 ms·
I actually like versions of #1 and #5 on some projects. Revision control usually has very fine granularity, whereas I like to be able to tell at a glance who wa
by _delirium 16y ago
I actually like versions of #1 and #5 on some projects. Revision control usually has very fine granularity, whereas I like to be able to tell at a glance who was mainly responsible for certain portions of code--- that Bob is the main person who wrote file.c, while Sue is the main person behind code.c, and John recently added major functionality to file.c. In-file comments also persist longer, so are particularly nice for open-source code. I've run across code from the 70s and 80s that's long since been separated from its version-control system as it floats around the internet, but the comments in the code still let me know who wrote what, and even a brief summary of its evolution.
And "just fix it" for #5 is ideal, sure, but on any significant project there are likely to be "temporary" workarounds that persist for a while and should be noted (along with who to ask for details), e.g. because they're workarounds for a third-party bug that you're waiting to be fixed, or new functionality hooks waiting on some module that isn't done yet.
- Lewisham 16y agoI actually setup Textmate to do a completion on # with # `whoami` | `date +"%Y-%m-%d"` | I find #1 to be very useful, primarily for the source control granularity issue. The other useful thing about these type of comments is that if you look through the code, and you spot something that looks like a hack job, usually a comment like that indicates it wasn't the original author who did it. If you're lucky, you'll be told why the hack job is in there, if you're not, you can at least begin the process of finding out (or removing if need be). #2 suffers from a similar invisibility problem in source control. I comment out code when it has the possibility to come back. However, if I'm not the primary author of the file, and a feature has been removed, the HEAD has no indications that the code was ever there. I wouldn't know about restoring it, I'd waste time reimplementing. I think the author's heart is in the right place, but it seems to me that he either has an encyclopedic knowledge of his team's codebase, or he only works on projects by himself. Tool support could help here (maybe Xcode 4 with it's timeline feature), where want you want is a button that says "show me all the lines this file used to have" in some sort of ethereal, back from the dead, view. GitHub does this somewhat with Compare View[1], but it would be nice from the editor as well. I'm sure someone will come in and tell me that emacs has had this for 20 years ;) [1]: Check out this huge one: http://github.com/sinatra/sinatra/compare/0.2.0...1.0.a#diff-61 http://github.com/sinatra/sinatra/compare/0.2.0...1.0.a#diff...