Programming is poetical science

Laptop screen with code

If you can’t give me poetry, can’t you give me poetical science?

Ada Lovelace

Today I read a couple articles on Ada Lovelace. She was the first programmer ever, which makes her the grandfather of my profession, programming 🤓 (a real G 😉). But she wasn't only a programmer, she was also a prophet.

Long before the formalization of universal computing by Alan Turing a century later, Ada predicted that computers would be used to create music, generate graphics, and even perform tasks beyond just mathematical operations.

What fascinated me about Ada Lovelace the most was the fact that she claimed that her knowledge of poetry helped her to make that prediction. She also coined the term poetical science.

What is poetical science?

Ada Lovelace didn't explicitly define the term poetical science, but she used the term to describe her unique approach to mathematics and science. She believed that imagination and insight can be paired with science to unlock new discoveries.

How is programming poetical science?

We may say most aptly that the Analytical Engine weaves algebraical patterns just as the Jacquard-loom weaves flowers and leaves.

Ada Lovelace, a display of her mastery of metaphor

Programming is essentially instructing a computer on what to do. However, like Ada described, when we program, we don't program by explicitly flipping switches on an electronic board (which is what essentially the transistors in all computers do); we program using a human-like language.

For instance, in object-oriented programming, we use objects. These objects are not real, just metaphors; they are representations of objects in real life. So a file in a program is not "a folder or box for holding loose papers", but a sequence of bytes that represents data in the system.

In Python, to open and read a text file called doc.txt, we could run the following code:

with open("doc.txt") as file:
    print(file.read())

Did you catch that? I said open and read even though the computer is just manipulating and transforming a sequence of bytes you call a file. It's all metaphor.

When you call open(), you are not really opening a file or opening a folder with documents inside; you are manipulating some bytes. And when you call read(), you are not really reading a file or deciphering text on a sheet of paper in a folder; you are transforming bytes to alphanumeric characters and rendering them on a screen.

As much as we think what we are doing as programmers is scientific, there is a lot of poetry that is mixed in.

The bottom line

Looking from Ada's perspective, we can conclude that programmers are machine poets; we tell the computer sweet nothings in rhyme and meter and she rewards us with her virtual innards.

It's nice to know that poetry lies at the very foundation of this art called programming; I need to read more Shakespeare to improve my coding skills 🙃.

If you would like to reply to or comment on this blog post, feel free to email me at efe@mmhq.me.