How many kilometers of code do you write?

By , May 26, 2014 7:24 am

I was reading an article today and the author said he was hired to write "kilometers of code" it got me curious… How much code does one need to write to write a kilometer of code?

How much code is a kilometer of code?

First we have to set the stage. With all the various fonts and font types out there we need to consolidate to one size. Due to sheer popularity lets us a 12 pt font. The calculation will be done on a per line basis (To really snaz this out put each character on one line!).

That standard height of a 12 pt font is 1 pica… I have no idea what a pica is but another quick search reveals that a pica is 4.2333x10(-3) millimeters, or more simply 4.23 millimeters.

1 kilometer contains 1,000,000 millimeters.

The formula to determine how many lines of code it takes with a 12 pt font to reach a kilometer is:
1,000,000 / 4.23 = 236,406.619385

For the sake of ease lets make the number of lines 236,406.

That is actually not many lines of code.

Kilometers of code in some popular projects

Lets look at a couple popular projects.

WordPress: 381,894 lines or 1.61 kilometers of code.
Jetpack (WordPress plugin): 418,439 or 1.77 kilometers of code.

Drupal: 320,856 lines or 1.35 kilometers of code.

Windows XP 45,000,000 or 190.35 kilometers of code.

Linux kernel 3.6: 15,900,000 or 67.25 kilometers of code.

Mac OS X 10.4: 86,000,000 or 363.78 kilometers of code.

How many lines of code are you writing? Drop a comment and let me know.

Leave a Reply

2 Responses to“ How many kilometers of code do you write?”

  1. says:

    Ooooh, nice one! You may have confused poetic license with literal accuracy, but still, great job! :)

Theme by Blam Designs
Based on Themocracy

  Globals Profiler (1,736.01 ms) SQL (81 queries in 1,069.29 ms) Errors (1) Toggle Close
$_GET = array (
);

$_POST = array (
);

$_COOKIE = array (
);

$_SESSION = array (
);

$_SERVER = array (
  'SERVER_SOFTWARE' => 'Apache/2.2.22',
  'REQUEST_URI' => '/blog/148720/how-many-kilometers-of-code-do-you-write',
  'PATH' => '/usr/local/bin:/usr/bin:/bin',
  'REDIRECT_HANDLER' => 'php-stable',
  'REDIRECT_STATUS' => '200',
  'UNIQUE_ID' => 'VHjFuUAN6B8AAH4UDCcAAACT',
  'SCRIPT_URL' => '/blog/148720/how-many-kilometers-of-code-do-you-write',
  'SCRIPT_URI' => 'http://ben.lobaugh.net/blog/148720/how-many-kilometers-of-code-do-you-write',
  'WM_UCONTROL_XMLRPC_SERVER' => 'http://10.0.0.13',
  'ACCESS_DOMAIN' => 's21288.gridserver.com',
  'DATABASE_SERVER' => 'internal-db.s21288.gridserver.com',
  'SITE_ROOT' => '/home/21288',
  'SITE_CGIROOT' => '/home/21288/cgi-bin',
  'SITE_HTMLROOT' => '/home/21288/domains/ben.lobaugh.net/html',
  'PHPRC' => '/home/21288/etc/',
  'HTTP_PHPCONF' => '88113199',
  'HTTP_HOST' => 'ben.lobaugh.net',
  'HTTP_ACCEPT_ENCODING' => 'x-gzip, gzip, deflate',
  'HTTP_USER_AGENT' => 'CCBot/2.0 (http://commoncrawl.org/faq/)',
  'HTTP_ACCEPT_LANGUAGE' => 'en-us,en-gb,en;q=0.7,*;q=0.3',
  'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  'SERVER_SIGNATURE' => '<address>Apache/2.2.22 Server at ben.lobaugh.net Port 80</address>
',
  'SERVER_NAME' => 'ben.lobaugh.net',
  'SERVER_ADDR' => '64.13.232.84',
  'SERVER_PORT' => '80',
  'REMOTE_ADDR' => '54.167.177.180',
  'DOCUMENT_ROOT' => '/home/21288/domains/ben.lobaugh.net/html',
  'SERVER_ADMIN' => 'webmaster@ben.lobaugh.net',
  'SCRIPT_FILENAME' => '/home/21288/domains/ben.lobaugh.net/html/index.php',
  'REMOTE_PORT' => '53104',
  'REDIRECT_URL' => '/index.php',
  'GATEWAY_INTERFACE' => 'CGI/1.1',
  'SERVER_PROTOCOL' => 'HTTP/1.0',
  'REQUEST_METHOD' => 'GET',
  'QUERY_STRING' => '',
  'SCRIPT_NAME' => '/index.php',
  'ORIG_SCRIPT_FILENAME' => '/etc/apache2/gs-bin/php-stable',
  'ORIG_PATH_INFO' => '/index.php',
  'ORIG_PATH_TRANSLATED' => '/home/21288/domains/ben.lobaugh.net/html/index.php',
  'ORIG_SCRIPT_NAME' => '/gs-bin/php-stable',
  'PHP_SELF' => '/index.php',
  'REQUEST_TIME' => 1417201081,
  'argv' => 
  array (
  ),
  'argc' => 0,
);

Profiler Initiaded 0.0000 ms 13910 kB
Profiler Noise 0.0319 ms 13911 kB
Profiler Stopped 1,736.0051 ms 33951 kB
16.7489 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'bwp_minify_advanced' LIMIT 1;
13.0789 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'prlipro_options' LIMIT 1;
13.0069 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'jetpack_id' LIMIT 1;
12.7811 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'gplus_authors' LIMIT 1;
12.9032 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'wp_mobile_app_promos' LIMIT 1;
12.9550 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'wp_mobile_disable' LIMIT 1;
12.8481 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'ap_stylesheet' LIMIT 1;
12.8469 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'ap_dateTimeFormat' LIMIT 1;
12.8732 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'widget_wysija' LIMIT 1;
12.7420 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'widget_akismet_widget' LIMIT 1;
12.8829 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'widget_toc-widget' LIMIT 1;
12.9330 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'widget_facebook-likebox' LIMIT 1;
12.8129 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'widget_gallery' LIMIT 1;
12.7671 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'widget_grofile' LIMIT 1;
12.7940 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'widget_image' LIMIT 1;
12.7780 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'widget_jetpack_readmill_widget' LIMIT 1;
12.7320 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'widget_rss_links' LIMIT 1;
12.8369 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'widget_upcoming_events_widget' LIMIT 1;
12.8648 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'widget_jetpack_display_posts_widget' LIMIT 1;
12.8710 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'akismet_comment_nonce' LIMIT 1;
13.4149 [ms]
SELECT * FROM wp_prli_links WHERE slug='148720/how-many-kilometers-of-code-do-you-write';
12.8269 [ms]
SELECT * FROM wp_prli_links WHERE slug='148720/how-many-kilometers-of-code-do-you-write';
13.1459 [ms]
SELECT * FROM wp_prli_links WHERE slug='148720/how-many-kilometers-of-code-do-you-write';
12.8500 [ms]
SELECT * FROM wp_prli_links WHERE slug='148720/how-many-kilometers-of-code-do-you-write';
12.9130 [ms]
SELECT * FROM wp_prli_links WHERE slug='148720/how-many-kilometers-of-code-do-you-write';
12.8579 [ms]
SELECT * FROM wp_prli_links WHERE slug='148720/how-many-kilometers-of-code-do-you-write';
12.9051 [ms]
SELECT * FROM wp_prli_links WHERE slug='148720/how-many-kilometers-of-code-do-you-write';
12.9731 [ms]
SELECT * FROM wp_prli_links WHERE slug='148720/how-many-kilometers-of-code-do-you-write';
12.9390 [ms]
SELECT * FROM wp_prli_links WHERE slug='148720/how-many-kilometers-of-code-do-you-write';
12.8100 [ms]
SELECT * FROM wp_prli_links WHERE slug='148720/how-many-kilometers-of-code-do-you-write';
12.9149 [ms]
SELECT * FROM wp_prli_links WHERE slug='148720/how-many-kilometers-of-code-do-you-write';
12.9261 [ms]
SELECT * FROM wp_prli_links WHERE slug='148720/how-many-kilometers-of-code-do-you-write';
13.0401 [ms]
SELECT * FROM wp_prli_links WHERE slug='148720/how-many-kilometers-of-code-do-you-write';
13.5839 [ms]
SELECT * FROM wp_prli_links WHERE slug='148720/how-many-kilometers-of-code-do-you-write';
12.8260 [ms]
SELECT * FROM wp_prli_links WHERE slug='148720/how-many-kilometers-of-code-do-you-write';
12.9709 [ms]
SELECT * FROM wp_prli_links WHERE slug='148720/how-many-kilometers-of-code-do-you-write';
12.8732 [ms]
SELECT * FROM wp_prli_links WHERE slug='148720/how-many-kilometers-of-code-do-you-write';
12.9189 [ms]
SELECT * FROM wp_prli_links WHERE slug='148720/how-many-kilometers-of-code-do-you-write';
12.8269 [ms]
SELECT * FROM wp_prli_links WHERE slug='148720/how-many-kilometers-of-code-do-you-write';
13.3231 [ms]
SELECT * FROM wp_prli_links WHERE slug='148720/how-many-kilometers-of-code-do-you-write';
13.2461 [ms]
SELECT * FROM wp_prli_links WHERE slug='148720/how-many-kilometers-of-code-do-you-write';
13.0410 [ms]
SELECT * FROM wp_prli_links WHERE slug='148720/how-many-kilometers-of-code-do-you-write';
13.0851 [ms]
SELECT * FROM wp_prli_links WHERE slug='148720/how-many-kilometers-of-code-do-you-write';
12.9061 [ms]
SELECT * FROM wp_prli_links WHERE slug='148720/how-many-kilometers-of-code-do-you-write';
12.9201 [ms]
SELECT * FROM wp_prli_links WHERE slug='148720/how-many-kilometers-of-code-do-you-write';
12.9790 [ms]
SELECT * FROM wp_prli_links WHERE slug='148720/how-many-kilometers-of-code-do-you-write';
13.6039 [ms]
SELECT   wp_posts.* FROM wp_posts  WHERE 1=1  AND wp_posts.post_name = 'how-many-kilometers-of-code-do-you-write' AND wp_posts.ID = 148720 AND
wp_posts.post_type = 'post'  ORDER BY wp_posts.post_date DESC ;
16.1259 [ms]
SELECT t.*, tt.*, tr.object_id FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr
ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('category', 'post_tag', 'post_format') AND tr.object_id IN (148720) ORDER BY t.name
ASC;
13.5219 [ms]
SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (148720) ORDER BY meta_id ASC;
13.6821 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'ap_rssUrl' LIMIT 1;
13.0532 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'ap_layout' LIMIT 1;
12.9850 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'ap_headerRotate' LIMIT 1;
13.1309 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'ap_linkColour' LIMIT 1;
15.3930 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'ap_hoverColour' LIMIT 1;
13.0670 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'disabled_likes' LIMIT 1;
13.5288 [ms]
SELECT p.ID FROM wp_posts AS p  WHERE p.post_date < '2014-05-26 07:24:30' AND p.post_type = 'post' AND p.post_status = 'publish'  ORDER BY p.post_date
DESC LIMIT 1;
13.2520 [ms]
SELECT * FROM wp_posts WHERE ID = 148705 LIMIT 1;
13.1500 [ms]
SELECT p.ID FROM wp_posts AS p  WHERE p.post_date > '2014-05-26 07:24:30' AND p.post_type = 'post' AND p.post_status = 'publish'  ORDER BY p.post_date
ASC LIMIT 1;
13.3300 [ms]
SELECT * FROM wp_posts WHERE ID = 149754 LIMIT 1;
13.1340 [ms]
SELECT option_value FROM wp_options WHERE option_name = 's4nometa' LIMIT 1;
13.0250 [ms]
SELECT option_value FROM wp_options WHERE option_name = 's4nofbjava' LIMIT 1;
13.1061 [ms]
SELECT option_value FROM wp_options WHERE option_name = 's4cjscript' LIMIT 1;
13.2790 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'ap_logoUrl' LIMIT 1;
14.5030 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'ap_includeHome' LIMIT 1;
13.6518 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'ap_pageMenuOrder' LIMIT 1;
13.6800 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'ap_pagesOmit' LIMIT 1;
14.1521 [ms]
SELECT * FROM wp_posts  WHERE (post_type = 'page' AND post_status = 'publish')     ORDER BY menu_order ASC;
13.7970 [ms]
SELECT * FROM wp_users WHERE ID = '2';
12.9430 [ms]
SELECT user_id, meta_key, meta_value FROM wp_usermeta WHERE user_id IN (2) ORDER BY umeta_id ASC;
13.0529 [ms]
SELECT option_value FROM wp_options WHERE option_name = 's4dispvb' LIMIT 1;
12.8849 [ms]
SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = 'category' AND t.term_id = 19
LIMIT 1;
12.9490 [ms]
SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = 'category' AND t.term_id = 5 LIMIT
1;
13.3522 [ms]
SELECT * FROM wp_comments  WHERE ( comment_approved = '1' ) AND comment_post_ID = 148720  ORDER BY comment_date_gmt ASC ;
13.0720 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'highlander_comment_form_prompt' LIMIT 1;
13.1299 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'jetpack_comment_form_color_scheme' LIMIT 1;
13.2570 [ms]
SELECT option_value FROM wp_options WHERE option_name = '_transient_timeout_wpcom_subscribers_total' LIMIT 1;
12.8751 [ms]
SELECT option_value FROM wp_options WHERE option_name = '_transient_wpcom_subscribers_total' LIMIT 1;
13.4671 [ms]
SELECT   wp_posts.ID FROM wp_posts  WHERE 1=1  AND wp_posts.post_type = 'post' AND ((wp_posts.post_status = 'publish'))  ORDER BY wp_posts.post_date
DESC LIMIT 0, 5;
13.1059 [ms]
SELECT wp_posts.* FROM wp_posts WHERE ID IN (183391,178652,176003,175127,175406);
13.0661 [ms]
SELECT t.*, tt.*, tr.object_id FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr
ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('category', 'post_tag', 'post_format') AND tr.object_id IN (175127, 175406, 176003,
178652, 183391) ORDER BY t.name ASC;
12.9130 [ms]
SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (175127,175406,176003,178652,183391) ORDER BY meta_id ASC;
Deprecated Assigning the return value of new by reference is deprecated on line 48 in file /nfs/c02/h13/mnt/21288/domains/ben.lobaugh.net/html/blog/wp-content/plugins/code-highlighter/codehighlighter.php
Add this ribbon to your WordPress website re-abolish slavery
%d bloggers like this: