the beautiful code
translated with Goggle traduction
in 1985 I imagine my code will remain well hidden
When I wrote the first lines for the Luchrone of Bourges, I didn’t think a program could be beautiful. Nor ugly. It was simply difficult to write.
Months went by, and the idea came to me to modify my code…
Catastrophe! My beautiful work had become incomprehensible. My friends at ASA-Logiciels laughed to see me so disturbed. They knew the solution: – You need to add as many comments as possible. Alongside the instructions for the machine, you need your own code!
Today, for me, a “beautiful program” is a page that I can understand a month later.
Good programmers write code that humans understand ¹
By changing a line or a word of code, we change the relationships
Ugly, confusing, and obscure code is the opposite of well-constructed and readable code. Many computer scientists say that a kind of harmony emerges from well-thought-out code, much like the musical aspect of mathematics.
explaining to human beings what we want the computer to do, rather than telling the computer what to do ²
“Computer programming is an art because it applies accumulated knowledge to the world, because it requires skill and ingenuity, and above all because it produces objects of beauty. A programmer who unconsciously considers himself an artist will appreciate what he does and do it better. Donald Knuth² - The Art of Computer Programming (2018)”
I must say that suits me.
==========================================================
Write code, and it either works or it doesn’t. Poetry knows neither success nor failure. Poetry waits to manifest itself. ⁴
On the Internet, you can find poets who express themselves in Python, Processing, Go, C++, Pascal, Javascript, Perl, etc.
Isaac Bertran’s Code Poems (2012) here in full PDF
See also: https://code-poetry.com/ https://www.researchgate.net/publication/355795978_Code_Poetry_and_Freedom https://writing.upenn.edu/epc/ (Electronic Poetry Center)
1 - Martin Fowler is an enterprise software consultant 2 - Donald Knuth: “I believe the time has come for a significant improvement in program documentation, and that the The best way to do this is to think of programs as literary works. Hence my title, literate programming.” 3 - Literate Programming 4 - According to Vikram Chandra, who financed his literary studies by programming, good code should have as much elegance as a poem. Geek Sublime.