Occasionally, I find myself wonder just how many lines of code I’ve written. Most of the time, I just run some combination of
wc. But that situation is far from ideal. It doesn’t account for comments, blank-lines, etc. Sometimes, I write a half-assed script to strip out some of the comments in the language I’m most interested in. Again, that has a some drawbacks, especially when I’m working on a multi-language project.
I did some Googling and came across CLOC. It’s just a simple Perl script that ran without any extra fiddling on my Leopard machine. When you run it, it gives you a breakdown of all the code in a directory or in a specific set of files, regardless of language. If your curious about the amount of code that you’ve written, or just how much cleaner things got after the last refactor, give this neat tool a shot.
Did you like this? Please share:
The Lost Year: A Failed Experiment to Switch Away From Mac
Fed up with the Apple Keyboard, I bought a ThinkPad, installed Linux, and promptly decided that I hated computers.
Maker's Space, Manager's Space
The Grand Remote Work Experiment: A Retrospective
The COVID-19 pandemic has lead to an unexpected experiment in remote working. What has worked and why?