most people know ada lovelace as “the first programmer.” that is true, but it is not the most interesting part about her. the real story is about how she used her imagination.
her father was the famous poet lord byron. her mother wanted her to study maths because she didn’t want ada to be a poet like her father. it is funny because ada combined both. she called it “poetical science”.
to ada, maths and poetry were the same thing. she believed that numbers could be poetry.
this is actually a proof of my last post code is poetry. coding is not just about writing instructions. it is about thinking, imagining, and writing something beautiful. and yes, ada did it first.
poetical science
in 1843, charles babbage was working on a machine called the analytical engine. it was a very early computer. babbage thought it was just a calculator for big numbers. but ada saw something else. she saw a future.
here’s a quote from ada.
the analytical engine weaves algebraic patterns, just as the jacquard loom weaves flowers and leaves.
she literally said writing code is like making art with maths. she was right. but that’s not all. she also said machines could be used to create music.
the engine might compose elaborate and scientific pieces of music of any degree of complexity or extent.
imagine saying this in 1843. she understood that if you have rules for music, you can use a machine to create it. she connected the logic of engineering with the beauty of art. she was a true poetical scientist, or programmer as we call it today.
the first code
in her notes, ada wrote an algorithm to calculate bernoulli numbers. these are special mathematical values used in many formulas. but what matters is how she wrote it.
she created step-by-step instructions for the analytical engine. loops, variables, conditions. yes, all the things we use today. this was the first computer program ever written.
if we write ada’s algorithm in modern python, it looks something like this.
from fractions import Fraction
def bernoulli(n):
A = [Fraction(0)] * (n + 1)
for m in range(n + 1):
A[m] = Fraction(1, m + 1)
for j in range(m, 0, -1):
A[j - 1] = j * (A[j - 1] - A[j])
return A[0]
print(bernoulli(10))
# 5/66
same logic, different language. the only difference is ada wrote this in 1843. incredible.
the sad part
ada published her notes as “A.A.L.” not “ada lovelace.” why? because in 1843, nobody would take a woman seriously in maths. with “A.A.L.”, many people thought a man wrote it. some thought babbage wrote it himself. the idea that a woman could understand machines better than men? impossible.
the irony? even babbage, who designed the machine, didn’t fully understand what ada saw. he thought it was just a calculator, but she saw a computer.
ada died in 1852 because of cervical cancer. she was just 36 years old. she never saw a working computer, but she still walks in beauty, in the lines of our code that she believed could be poetry.