Programming Languages: What Would Tolkien Say?

Programming Languages: What Would Tolkien Say?

Languages can be spoken. Languages can be signed. Languages can be written. There are romance languages, and there are Germanic languages. We use language to compose stories and shape fantastical worlds that never existed. We use other sorts of languages to create video games and build virtual worlds. You might stumble upon these virtual worlds each time you use a SmartPhone or personal computer. Each time you visit a website, you enter a province of the world wide web, a world built by languages — programming languages.

No One Quotes Programming Languages…

It doesn’t seem fair, however, that programming languages which build web applications receive so little credit yet they contribute so much. Jewelers fashion necklaces, bracelets, and broaches that read “Je t’aime”, but never a locket that reads “<?php for($i;$i><5;$i++);?>” Put simply, programming languages are ugly. They tell no stories and convey no emotion. So I will make PHP beautiful.

… But People Quote J.R.R. Tolkien

J.R.R. Tolkien wrote with such eloquence that his tales of hobbits, elves, and dwarves will endure for ages. I shall translate a famous passage of his masterpiece, The Lord of the Rings into simple PHP statements, to bring splendor to the wretchedness of PHP.

Tolkien:
“Three Rings for the Elven-kings under the sky,

Seven for the Dwarf-lords in their halls of stone,

Nine for Mortal Men doomed to die,

One for the Dark Lord on his dark throne…
…
One Ring to rule them all,
One Ring to find them,

One Ring to bring them all
and in the darkness bind them”


PHP:

<?php
$great_rings = 20;
foreach($elves as $elf) {
	$elf['status'] = 'king';
	$elf['under_the_sky'] = true;
	$great_rings--;
}
foreach($dwarves as $dwarf) {
	$dwarf['status'] = 'lord';
	$dwarf['in_stone_halls'] = true;
	$great_rings--;
}
foreach($men as $man) {
	$man['status'] = 'mortal';
	if($man['status'] == 'mortal')  { $man['doomed_to_die'] = true; }
	$great_rings--;
}
$one_ring = new ring();
$one_ring->rule('all');
$one_ring->find('them');
$one_ring->bring('all');
if($in_darkness)  { $one_ring->bind('them'); }
?>

Languages Build Worlds

Although PHP does not embrace the same poise as Tolkien’s literary masterpiece, it still could fashion a small realm of elves and magic rings on the world wide web. Programming languages can create many worlds that a user might seek, from a simple storage space to online portfolio galleries.

By: Sarah

The comments are closed.

No reviews yet