Count Lines of Code in C#

by Brett on December 4, 2007

When I am programming I often wonder how much code I have actually typed. Sometimes when I get in the zone, have a well thought out design and have auto-completion helping, I can generate code pretty quick. Although there are quite a few programs out there that will count the lines of code some are a bit more intelligent than others.

At the most basic level a simple command in DOS can count the lines of code in a file or directory. But, I often want to a little more than just the the number of lines in each file. I want to know things like the lines of code vs empty lines and the number of lines that contain comments. Fortunately, there is a plug-in for Visual Studio that will do just that. Since, I am normally using Visual Studio to write any program in C# this is a very logical place to have this tool.

C# count lines of code

My next mission will be to find a good line counter for Java. Anyone know of any?

Previous post:

Next post: