Welcome to MSDN Blogs Sign in | Join | Help

aWorkBlogByGus

Gus Perez on Windows Azure Tools for Visual Studio and other stuff...
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.
Posted: Thursday, April 22, 2004 8:13 PM by GusPerez

Comments

Woon Kiat said:

Is the result include whitespace like newline, '{', '}', etc....?
# April 22, 2004 8:28 PM

Gus said:

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.
# April 22, 2004 8:36 PM

RichB said:

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.
# April 22, 2004 11:28 PM

RichB said:

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.
# April 22, 2004 11:27 PM

RichB said:

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.
# April 22, 2004 11:28 PM

Darren Neimke said:

Did they get in trouble for hacking it up in Perl .... {snicker}
# April 23, 2004 4:27 AM

Gus Perez said:

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.
# April 23, 2004 7:56 AM

Sharad said:

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
# August 5, 2004 1:08 AM

Ashish Ranjan said:

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

# March 4, 2006 6:41 AM
New Comments to this post are disabled
Page view tracker