
![]() |
2 people marked this as a favorite. |

OK - we've had our fun. A few questions:
1) With all that code, how many lines of comment did you write? How much documentation?
2) Does anybody think "number of lines of code written" is a useful metric?
On a couple of occasions over the years I've spent a large amount of time (days - sometimes weeks) tracking down and replicating obscure and/or intermittent bugs deep in the bowels of large and complex systems. In two of the toughest challenges the eventual solution turned out to be a very minor code change, modifying a single line of code (in fact in one case it was modifying a single instruction in an assembler source file). The last time I did this I was working (indirectly) for HP, and we did have to track these sorts of figures. My immediate boss and I took great satisfaction in reporting to HP that I had spent slightly over two weeks to generate a single line of code. As we noted, it wasn't changing the line of code that was important - it was knowing which line to change.

![]() |

1) With all that code, how many lines of comment did you write? How much documentation?
In the case above, there was no comment or documentation. It was a fairly simple image upload function. That said, I did copy/paste in a comment from a text document I have where I keep all my comments, just in case someone else has to use my code, after I'd written the actual code.

![]() |

I don't really count. This is pretty subjective anyway. I tend to write shorter lines of code than most people, so I tend to get more lines out of the same code. I've had people come to me and ask for help debugging something where all their lines of code are 100-200 characters long, and the first thing I do is break up the clauses into shorter lines to make it easier to read.

![]() |

I used to work for a company that still used Cobol as their primary language when I left them 4 years ago, and I doubt that's changed since. I learned how to skim it to figure out when variables are getting set, for trouble shooting purposes, but I never learned all the details of the syntax to be able to write it. But I was also working support, not a programmer.

Bobson |

Inspired by this thread, I went to our subversion server and pulled out some stats:
I have touched 578,495 lines of code between 1/4/11 and 11/12/12. That works out to an average of 853.2 lines of code per day, including weekends and holidays.
A lot of that is inflated by auto-code written by the Visual Studio designers, and it includes a lot of changes to existing code rather than new lines from scratch, but I'm pretty sure I'm being conservative in saying that I'm likely to touch over 200 lines of code on a slow day.

Bobson |

but I'm pretty sure I'm being conservative in saying that I'm likely to touch over 200 lines of code on a slow day.
And ironically enough, today I maybe wrote 100 lines tops, because I spent all afternoon trying to set up 3rd party shipping software. Two and a half hours wasted to an extra "-"...