How many lines of code is your app?

This seems like a silly question to ask,yea? A couple of months ago, i felt the same way. I laughed anytime someone asks “How many lines of code did you type today?” or “How many lines of code would it take to build this app?”. It seemed like a really funny question to me cause, lets face it, modern apps — regardless of the platform — are not all written in a single file. There are config files, param files, constants files etc, and then the main app files, which all vary depending on the language, framework, design pattern etc. Having to go through all these files to count the number of lines used just seemed like a funny idea to me. Accompanied with the fact that, a function/method that one person wrote with 4 lines, could be written by another person in 2 or less. Also, considering languages like JavaScript that aren’t “indentation enforcing”, an entire module could be written in one line, albeit unreadable, but still just one line. Would you consider a developer that did that to be better than one who wrote his code with proper indentation and spacing?

All these and a couple of other facts are why i never really considered “lines of code” as an accurate judging criteria of a developer’s prowess. Well, that was until I saw the form fields in the Ycombinator application form. Among them was the very same question, which I always found funny:

“How many lines of code is your app?”

This had me thinking. If this really wasn’t an important standard for measuring developer skillfulness, why was the most powerful startup incubator asking for it? I understand lesser lines of code could indicate increased efficiency and performance, and could also imply faster compile times and overall better memory management, but could there be more to it than that?

After doing some research, i found out that the number of lines of code used in developing a software, is actually sort of a Big deal. For the reasons stated above (compile time, memory management etc), and also for bragging rights as well 😀😀😀. Why exactly YC is asking about this, is still unknown to me (Pray for me, that my company gets in, so i can ask the partners personally 😉). My guess is, they probably want to use it as a metric to see how much your codebase has grown from pre-YC up to demo day.

As to whether or not “lines of code” is a good standard for measuring developer skillfulness, or hours put into work, this fact is still debatable, and is often frowned upon by developers. But knowing the number of lines of code your app currently has is still recommended, as this can be used to see how much improvements have been done on the app over time.

InformationIsBeautiful has a pretty cool summary of various software and the number of lines of code used in building them. Click here to see the list. The numbers may be quite overwhelming, but don’t be intimidated. Just remember that they all started from a single line. 😉

So, lets say you wanted to find out how many lines of code you app currently has, how exactly do you go about this? If you’re planning to start counting the lines in each file in your project directory, please just stop. That wouldn’t be healthy at all.

There’s this pretty nifty tool called CLOC (Count lines of Code), that you can use to achieve that. It recognizes a large number of programming languages, detects white spaces and comments (can strip them off as well), calculate difference of two files etc. Its pretty cool actually. Easy to install to. It can be installed via a package manager (npm, apt, etc), or via its executable file, if you’re a Windows user, like Me 😜

So check it out, see how many lines of code your current app has. I have about 536,721 lines of code spread across two platforms of the same app (Android and Web). Check yours and write it down in the comments below 😁.

P.s: Pardon my excessive use of Emojis, apparently I’m an Emoji freak 🙈. If you’re wondering how I got to use them here on medium (I’m not using a mobile phone), check out this Emoji Extension for Chrome. It was a small hack I did a while back, just for the love of Emojis 😍😍. Feel free to download and check it out. Reviews, comments and suggestions are all welcome.