Lab 2: Humanities & Coding

Should Humanities Students learn to code?

If given the option, I think Humanities Students should learn to code! Why? for the most part learning to code is quick and accessible. Anyone is capable of watching free coding tutorials on youtube, which, in my experience, can cover a whole semester of Intro CS material in ~6 hours. Learning basic coding skills can open up a digital segment of the humanities and allows students the ability to use a more types of data in their projects.

What are a snowball’s salient characteristics? What do you do with one? Well, you toss the snowball at someone else. But wait, before you do that, you first have to shape it, form it, pack the snow. Once you do toss it, do you still have it? No. So the program has to be able to distinguish between possession and nonpossession of the snowball. And maybe, if you hang onto it too long, it starts to melt.

Matthew G. Kirschenbaum, Hello Worlds (why humanities students should learn programming)

I love that quote because it describes coding so accurately. Even simulating something as “simple” as simulating a snowball requires lots of thought on every aspect of a snowball, and then once you think you have thought of everything another problem comes into play. The quote also describes the “one step at a time” way in which coders think while programming which I think could be a valuable exercise for humanities students.

My prior coding experience

I have known Python since Junior year of High-school when I watched a ~5 hour beginner tutorial on Youtube. I never took a Computer Science course until college, where I discovered how much I actually liked the subject. At Carleton I learned Java in a class called “Data Structures” and solidified my Python knowledge in “Intro to Computer Science.” I’m not sure why I like coding or what prompted me to begin coding before taking a class but I have thoroughly enjoyed each CS course I have taken. I liked the HTML and javascript tutorials we did for this lab, however I still prefer following along with a Youtube video compared to reading through a tutorial.

Sample Code

This is a piece of code I wrote to show the most common letter in this paragraph. Although this may not be the most useful example of code it should show how easy it is to draw conclusions from just about any type of dataset. If you feel like running the program try pasting in your own paragraph! Keep in mind that this program could be improved in many ways. For example instead of just printing out the letters in whatever order they appeared in the paragraph I could place the letters in alphabetical order or sort greatest to least frequent. If you tasked another programmer to make a program with the exact same goal as mine it’s very likely their solution would look different from mine.

#Finds most common characters in a list of names/words

paragraph = "This is a piece of code I wrote to show the most common letter in this paragraph. Although this may not be the most useful example of code it should show how easy it is to draw conclusions from just about any type of dataset. If you feel like running the program try pasting in your own paragraph to the code! Keep in mind that this program could be improved in many ways. For example instead of just printing out the letters in whatever order they appeared in the paragraph I could order the letters in alphabetical order or from greatest to least frequent. If you tasked another programmer to make a program with the exact same goal as mine it's very likely their solution would look extremely different from mine"

letterList = []
letterDict = {}

for letter in paragraph:
    letter = letter.capitalize()
    letterList.append(letter)

for letter in letterList:
    letterDict[letter] = 0

for letter in letterList:
    letterDict[letter] += 1

for letter in letterDict:
    if letter != " ": 
        print(letter + ": " + str(letterDict[letter]))

Results:

T: 59
H: 28
I: 38
S: 30
A: 45
P: 21
E: 67
C: 11
O: 53
F: 15
D: 18
W: 10
R: 45
M: 23
N: 28
L: 23
G: 13
.: 4
U: 18
Y: 14
B: 4
X: 4
J: 2
K: 6
!: 1
V: 3
Q: 1
‘: 1

Final Thoughts

I think Humanities students should learn to code because it’s a skill that can make work in other fields more efficient. Computer Science Problems require a different kind of problem solving mindset which can be valuable in areas of study that don’t require code. In general, learning is good, so why not learn to code?

1 thought on “Lab 2: Humanities & Coding

  1. You make a good point of computer science being both accessible and allowing for a different type of problem solving. You mention how coding could make humanities fields more efficient. I would love to hear more on what you mean by that. Do you mean that it in a way that it would speed up new discoveries or spread information faster or do you mean it all aspects it would be more efficient? In any way though, I do see that coding could be quite a valuable skill.

Comments are closed.

css.php