16, మార్చి 2014, ఆదివారం

Programming Concepts for the Humanities: ArrayLists


In a recent post, I used Dante’s Inferno as an entry point to the concept of Arrays and machine counting in general (that is, that it starts with 0 instead of 1).

Arrays are fixed-length, like the Inferno is, but perhaps a creative individual would like to add or subtract circles of Hell. Say, she was really frustrated trying to parse through Dante’s text and does not find his language to be anywhere near as elegant as Latin poets, so she would like to add Vernacular Poets into the very pit of Hell.


In Java, for example, a programmer can import ArrayList:

import java.util.ArrayList;

Then, she will create her list of Sinners:

ArrayList myInferno = new ArrayList();

In the example above, she is using Dante’s original scheme, but she can certainly start from scratch. Once her Inferno is populated with Dante’s sinners, she will add her new Sinner category last:

Sinner vernacularPoets = new Sinner();
myInferno.add(vernacularPoets);

From here, she can make the Inferno as big as she would like.

Perhaps another creative individual actually is really touched by Francesca da Rimini’s speech in Canto V and he nearly faints after he hears it (kind of like Dante-Pilgrim). He may want to only modify the Inferno by taking the Lustful out, and letting Purgatory sort those sinners out in a more redemption-focused way.

He will achieve this by writing out the command

myInferno.remove(2);

What is great about the landscape of the Inferno, is that we know right away which circle we want to take out — the Lustful are in Circle 2 (or technically the third circle from the beginning), and it is easy to call that right up to remove in programming since it corresponds exactly.

After this command, his myInferno ArrayList will shift to look like this, with one last circle, and everything shifted down:


If Dante’s Inferno is too unfamiliar, we can also think about adding or subtracting Dissertation chapters – something all Humanities scholars should have some experience with!

Related Posts

Programming Concepts for the Humanities: ArrayLists
4/ 5
Oleh