News for hackers. Stuff that matters.
Re:Document the Why by ctdonath on Wednesday March 06, 2013 @12:11PM (#5332231)
"When" too. Nice to know whether the weirdness was added last week or last decade. I've left old obtuse comments in place just as proof that the function, as written, was there for the last 14 years (which sometimes explained a lot).
Re:Document the Why by Ensorceled on Wednesday March 06, 2013 @06:39PM (#5334835)
I don't find when useful, except in post mortem situations. The code is the code. Trying to capture history leads to things like old code being commented out to preserve the context. Use a good code repository instead.
Re:Document the Why by mercurial on Wednesday March 06, 2013 @02:19PM (#5333192)
git annotate?
Re:Document the Why by ctdonath on Wednesday March 06, 2013 @03:08PM (#5333482)
I'm talking code that has out-lived several "yeah we'll use this forever" version control systems. If the comment isn't in the code it will get lost.
Re:Document the Why by ZoFreX on Wednesday March 06, 2013 @04:30PM (#5334106)
FWIW you can actually migrate between most major VCS systems without losing your history.
Re:Document the Why by Someone on Wednesday March 06, 2013 @04:51PM (#5334249)
Yes, but it is neigh impossible to migrate from say Python to C, a copy-paste into an entirely different project, and from there via Java to C# and keep history. That may be a stretch, but even one such step will almost certainly lose history.
Re:Document the Why by mercurial on Wednesday March 06, 2013 @05:23PM (#5334445)
It also depends on what kind of stuff you've done with your VCS. "Creative" SVN layouts may be difficult to merge.
Re:Document the Why by ctdonath on Wednesday March 06, 2013 @08:29PM (#5335349)
That's assuming somebody remembers where it was.