Random fun fact: Lines of code in our C# compiler test suite


For some reason, that I don’t remember now actually, one of the guys on my team had to write a quick Perl script to get the number of lines of C# code in a set of source files. He ran it against our test suite and 2,225,546 came out the other end. Not sure how we’d use this data, but we still found it somewhat amusingly interesting.

Comments (11)

  1. Woon Kiat says:

    Is the result include whitespace like newline, ‘{‘, ‘}’, etc….?

  2. Gus says:

    I know he said it didn’t include whitespace (blank lines), but it probably would include lines with a single brace on them, etc. I don’t think he spent much time on the script.

  3. RichB says:

    Compare this count with the number of lines of code in System.Xml (and XSLT and Serialization) codebase in the ROTOR stack. System.Xml contains 100,000 LOC including whitespace and comments.

  4. RichB says:

    Compare this count with the number of lines of code in System.Xml (and XSLT and Serialization) codebase in the ROTOR stack. System.Xml contains 100,000 LOC including whitespace and comments.

  5. RichB says:

    Compare this count with the number of lines of code in System.Xml (and XSLT and Serialization) codebase in the ROTOR stack. System.Xml contains 100,000 LOC including whitespace and comments.

  6. Did they get in trouble for hacking it up in Perl …. {snicker}

  7. Gus Perez says:

    If Perl would get us in trouble, we would have been out of jobs long ago. We use it quite a bit, actually, most of our harness is in Perl.

  8. Sharad says:

    Where can i find this code? Can I get a copy of this code. We have such a requirement in our project. We can have done it but we were searching for some inputs to start with. Any help would highly be appreciated. please send it to skverma_in@yahoo.com

  9. Ashish Ranjan says:

    i dont know much about the perl. But, just as a passing observation, by the way, In the linux (or *nix) command shell level itself this can be done in a single command line , for example as:

    find . -name "*" | xargs -i wc -l ‘{}’ 2> /dev/null  | awk ‘BEGIN {cnt=0;} { cnt=cnt+$1} END {print cnt; }’

    As all these utils are already ported to windows too, so the same thing can be done in windows with help of these utils.

    hope it helps somehow.

    bye 🙂

    Ashish Ranjan

    ashishwave@yahoo.com