Live data from Hacker News

Code Archeology – Lines of code by age

smrrd.de

1–10 of 20 posts

Re: Code Archeology – Lines of code by age

#2
Ha I just did a little RubyGem to find files of which x% of the lines are more than y years old - the olde_code_finder:

http://thomasleecopeland.com/2014/09/18/olde-code-finder.htm...

Actually, the first version only found files where x% of the lines were written by a particular author. Then someone gently suggested checking the line age, which made perfect sense.

Re: Code Archeology – Lines of code by age

#4
Which do we prefer, though? As an industry, we seem to chose the "new shiney" way more than the alternatives. To the point that "hasn't been touched by the author in a few years" is a warning sign more than a sign of completeness.

Re: Code Archeology – Lines of code by age

#5
post #4

Which do we prefer, though? As an industry, we seem to chose the "new shiney" way more than the alternatives. To the point that "hasn't been touched by the author in a few years" is a warning sign more than a sign of completeness.

It's not an issue of preference, but understanding. Knowing how code has evolved can help us understand it. And I particularly liked the point the author raised about comments: it's valuable to know how old a comment is, in case we suspect it no longer reflects the code.

Re: Code Archeology – Lines of code by age

#6
post #4

Which do we prefer, though? As an industry, we seem to chose the "new shiney" way more than the alternatives. To the point that "hasn't been touched by the author in a few years" is a warning sign more than a sign of completeness.

I didn't want to make it look that way. The color indication is without any judgment. It's just interesting how code evolved over time. In fact you should reverse the color gradient or use different colours, so you can read code how you prefer it.

Re: Code Archeology – Lines of code by age

#8

> Remember - the lighter the color, the older the code. I really think it should be the opposite. Recent code should be clearly visible and older code should progressively interpolate into black. The current setup is extremely unintuitive for me.

That it's so interesting. A lot of people said that to me. But to me it felt more natural to highlight old code. Probably because I had this bias in the back of my mind that old code could be bad code.

Re: Code Archeology – Lines of code by age

#10
post #8

> Remember - the lighter the color, the older the code. I really think it should be the opposite. Recent code should be clearly visible and older code should progressively interpolate into black. The current setup is extremely unintuitive for me.

That it's so interesting. A lot of people said that to me. But to me it felt more natural to highlight old code. Probably because I had this bias in the back of my mind that old code could be bad code.

In my experience, it's often the new/changed code that is the most interesting. It's often the code that is causing some unexpected bug. 'No one sews a patch of unshrunk cloth on an old garment. Otherwise, the new patch pulls away from the old cloth, and a worse tear is made'
Post reply on HN