Advertisement

Article

Code by the Numbers: How Many Lines of Code in Popular Programs, Apps, and Video Games?

Millions of lines of code are needed to program the apps that accompany us every day

Code by the Numbers: How Many Lines of Code in Popular Programs, Apps, and Video Games?
Mireia Fernández

Mireia Fernández

  • Updated:

You may not often think about it, but behind every operating system, program, application or video game you use every day there are thousands or even millions of lines of code. An everyday action such as doing a Google search or checking your email in Gmail may seem simple but… Do you know how many lines of code are hidden behind the services of the big G? More than 2 billion! But is that a lot or a little? And if a program has many lines of code does it mean that it is better?

In today’s article we are going to dive deep into the world of programming and share with you how many lines of code the most popular programs, video games and operating systems of the moment have. We predict that you will be surprised!

How to find out how many lines of code a program has

To begin our article, we are going to show you how to calculate the source code lines of a program. Don’t worry because you won’t have to do it by hand. Fortunately, there are many programs with which you can find out the lines of code in just a few clicks.

If you want to calculate the number of lines of source code of a program, the procedure is quite simple:

  1. Download the source code of the program and unzip it in a folder.
  2. Download CLOC (Count Lines of Code) and copy it to the Windows directory.
  3. From the path where the folder with the code is located, type the command cloc <folder>

CLOC recognizes more than a hundred programming languages, and its report separates the code from blank lines and comment lines, which allows a more accurate calculation of the number of lines in the program.

Does more lines of code mean that a program is better?

Absolutely not. When we measure the lines of code of any software, we should not focus on whether a program has many or few lines of code, but on the results. In fact, most programmers are guided by the maxim that quality is better than quantity. It is therefore not surprising that, when creating a program or application, they always seek to optimize the results with as few lines of code as possible.

There is nothing better than an example to demonstrate this point. Imagine that a programmer creates an application with 1 million lines of code. Each and every line of that code is intended to display the message “Hello! How are you?” continuously. As you can see, just because the program has a large amount of code does not mean that it is complex.

Keep in mind that two of the maxims that every self-respecting programmer uses are DRY (Don’t Repeat Yourself) and KISS (Keep It Simple, Stupid). Although it is true that depending on the programming language used, more or fewer lines of code are needed, we will always try to optimize the results.

Are all lines of code part of the program?

No. A good programmer not only writes lines of code, but also adds notes and comments within them. These, although they are not part of the code as such (since they are not read by the computer, mobile or console), would be included in the line count. It should also be taken into account that programmers leave a large number of blank lines that, in the long run, constitute part of the word count.

How many lines of code do the main operating systems have?

In terms of complexity and number of integrated tools, operating systems are the software that usually have the most lines of code. Most of them are programmed in C and assembler, less tidy but more efficient languages.

A notable example is Mac OS X, Apple’s operating system, which contains more than 86 million lines of code. On the other hand, Windows XP has 45 million lines of code, while a complete Linux distribution can easily exceed 300 million.

Below is a list of the lines of code of some of the most widely used operating systems on the market:

  • MS-DOS– 4000 lines of code
  • Windows NT– 2 million lines of code
  • Windows 3.1– 2 million lines of code
  • Windows 7– 40 million lines of code
  • Windows XP– 45 million lines of code
  • Windows Vista-50 million lines of code
  • Windows 10– 80 million lines of code
  • Ubuntu– 50 million lines of code
  • MacOS X– 84 million lines of code
  • Android– 12 million lines of code
  • iOS– 12 million lines of code

How many lines of code do the most famous programs, apps and games have?

If you’ve ever wondered how many lines of code your favorite browser has, the social network you open on your mobile or that messaging app you can’t live without, you’ve come to the right place. And today we’re going to put your mind at rest.

Although there are many factors that influence the number of lines of code in a program (its design philosophy, the language used, the number of comments inserted, etc.) these are the approximate numbers for each of them.

Web browsers

Office suites

Social networks

Messaging apps

Media players and audio and video editors

Image editors

P2P programs

  • Ares Galaxy– 1,176,679 lines of code
  • eMule-2,437,791 lines of code
  • BitTorrent– its protocol has only 8,633 lines of code
  • Vuze– 967,990 lines of code

Web applications

  • WordPress– 160,636 lines of code
  • Google Suite (Gmail, Drive, Search, etc.): 2 billion lines of code
  • Reddit-139,659 lines of code
  • Menéame– 23,190 lines of code

Video game

This is what the programs look like through their lines of code

We hope that this article has helped you to learn a little more about how the lines of code of your favorite programs work and which ones have a greater number of them. As you can see, some of the results are simply amazing. And the fact is that hardly anyone would imagine that Google services have more than 2 billion lines of code. Remember, though: More code does not mean that a program is better.

Did you like what you read? Share this article with your friends on social networks!

Mireia Fernández

Mireia Fernández

Mireia Fernández es una apasionada del mundo de los videojuegos y las nuevas tecnologías cuya afición se remonta al MSX HB 501p de su niñez. Nacida y residente en Barcelona, Mireia lleva más de 10 años ejerciendo como editora y está especializada en la redacción de análisis, tutoriales y guías de software así como también en darlo todo para tratar de publicar noticias antes que nadie. Entre sus aficiones está pasar horas y horas jugando con la consola, pasear a su golden retriever y mantenerse al día de las novedades del mundo SEO.

Latest from Mireia Fernández

Editorial Guidelines