DEV Community

Discussion on: How do you count your lines of code?

Collapse
 
bradtaniguchi profile image
Brad • Edited

I use sloc when I'm curious about the amount of lines and TODO's are in the project/folder/whatever.

I work on web projects, so npm and thus this package is right at my finger-tips with: npx sloc src

Here's an example output for an old project I did a while back:


---------- Result ------------

            Physical :  2723
              Source :  1935
             Comment :  816
 Single-line comment :  152
       Block comment :  664
               Mixed :  107
 Empty block comment :  0
               Empty :  79
               To Do :  7

Number of files read :  37

----------------------------
Enter fullscreen mode Exit fullscreen mode

I don't believe line-count means that much. I usually abuse formatting for extra lines. Its a "nice-to-know", something to brag to your friends about, but that's about it. I'd consider it like writing a good novel. More pages doesn't mean its a better book, it could be, or it could be not.