count lines of code.png




As a programmer there has probably come a time where you’ve wondered exactly how many lines of code you’ve actually written. I was actually wondering this the other day, and searched around for the best way to figure it out. That’s when I stumbled across the free and portable FileStats app for Windows.

What you do is point FileStats to the directory on your computer where all of your code resides. It will navigate through all of the files in a particular directory recursively diving through subfolders, and then it will return with an aggregated count (grouped by file extension) of the number of lines of code you’ve written.

There’s only one problem that I’ve found with FileStats so far. After you open it for the first time you my want to go to the Options -> Preferences and add all the extensions you typically write code in. I disappointingly found that a lot of extensions, such as “.c”, are not included in the list of file extensions that should have their number of lines counted. So if you run this out-of-the-box you may think it’s not working since it will just return zero for the number of lines of code for most of your filetypes.

I decided to download the source code for Pidgin, which is an awesome open source instant messenger application. I ran it through FileStats and it came out with the numbers you see in the screenshot above. In all there is over 1.8 million lines of code that makes up the instant messenger. Now that’s cool.

FileStats Homepage (Windows only; Freeware; Portable)