Coding Experience

As a way to demonstrate my proficiency in different programming languages, I calculated the total number of lines of code per programming language from all the projects in my project repositories. I include projects from my BitBucket, my GitHub, and my public and private Mercurial repositories.


The total number of lines of code for all languages was 245,000, with the highest counts coming from C++ 94,000 and Perl 62,000. I use reStructuredText as my light markup language for my notes and Python for my personal projects.

I've been writing software since 2012, which corresponds to around 100 new lines per day. This measurement obviously cannot account for removal or modifications of old lines.

Here's how I calculated the number of lines per language across all my projects. First I downloaded a snapshot of the most recent commit to each repository. Then I calculated the number of files by filetype by running this command (Stackoverflow comment):

find . -type f | perl -ne 'print $1 if m/\.([^.\/]+)$/' | sort | uniq -c | sort -n -r

I selected the filetypes with a reasonably high count. Then I determined the number of lines of each type of file with these commands (Stackoverflow):

for lang in "*.txt" "*.rst" "*.pl" "*.py" "*.html" "*.R" "*.pm" "*.cpp" ...
echo $lang # To print what filetype its counting
( find ./ -name $lang -print0 | xargs -0 cat ) | wc -l