Weekly Newsletter #15: Coding Philosophy

As I have said on other occasions, code is language and programming is a natural evolution of writing. In my opinion — I am a biased observer — philosophy and literature are the high points of textual culture. Mathematics comes a close third, but I tend to subsume mathematics under philosophy, since it’s a humanistic pursuit masquerading as science. Let’s set literature aside for the moment and ask how writing influences philosophy and mathematics.

Philosophical prose is most effective when it invents new forms of writing. Technical concepts are essential, but so are symbolic representations, of which logic is the most important. Logic has been the medium of philosophizing. Starting with Aristotle but greatly enhanced in the last hundred odd years, we expect rigorous philosophical argument to be cast in logical form.

Logic was my first love before I turned toward other mathematical pursuits, but I didn’t find it expressive enough for my needs. On the other hand, while mathematics is expressed formally, it doesn’t concern itself with the nature of form itself. So we are stuck with two alternatives:

  1. Logic, with its emphasis on syntactic form and lack of expressive richness
  2. Mathematics, with it’s extraordinary diversity of expression, but lack of curiosity about the nature of form

Is there a third alternative? I believe so; in fact, I am beginning to think that programming is that alternative. Programming is rich in expression — it is grounded in text, but makes room for many other sensory inputs; it also interfaces with most of the devices we make these days. Programming also concerns itself with the nature of form — one look at the sharp debates about the merits of various programming languages (C vs C++ vs Lisp vs Haskell vs Javascript) and programming paradigms (OO vs Functional vs Imperative) shows the depth of concern over the form of programs, not just their content.

In this picture, programming is distinct from the theory of computation. In fact, the two are no more related than literature is related to the theory of pens and pencils. It’s time to abstract programming from it’s origins in computation. Once you do so, it becomes clear that code is an excellent vehicle for philosophy. Let’s take a look at one prototypical use of programming to improve current philosophical practice.

For the most part, philosophical arguments are written in prose with a leavening of logic — if you’re working in the analytic tradition; I have no idea how continental philosophers leaven their prose. The architecture of these arguments is difficult to decipher. Try reading Kant’s Critique of Pure Reason and you will see what I am talking about. Philosophers do use tools such as thought experiments to convey their intuitions, but the arguments remain as dense as ever.

Now imagine rewriting philosophical arguments as computer programs, with thought experiments and other “active” elements being written in code and the main flow of the argument in the comments (as in commenting on the code). Further, we can modularize philosophical arguments into separate code chunks and invoke relevant chunks as function calls or as separate modules. A typical argument module would look like this:


include veil_of_ignorance
begin argument
end argument

The cognitive advantages alone are worth the effort — it’s so much easier to create shared mental models when the design of an argument is well organized and available at a glance. When expressed in code, philosophy becomes an active discipline; a discipline one can experiment with and demonstrate to the public. These are some of the deepest intuitions that human beings have ever had about the nature of reality. All of us care about them but most of us can’t access them except in a watered down or new-agey form. That’s a real pity. Socrates conducted his philosophizing in public, our in the street. Programming can help return that spirit of street metaphysics. Code can do to philosophy that calculators did to arithmetic.

I am deliberately staying away from the idea of philohacking, but the phrase is on the tip of my tongue. Philohacking makes it that much harder to bullshit one’s way through philosophizing. At the same time, philosophy will get a second wind; it will no longer be consigned to it’s current role as a commentator on the sciences. Instead, this oldest of subjects will reconnect with it’s roots in the aesthetic and creative impulse.

The advantages for programming (and programmers) is equally deep. For one, the philosophical lens will help formalize what all programmers know already: the comments are as important as the code. Philosophical training can help programmers become as rigorous and creative about the comments as they are about the code they write. Think of the philosopher as the yin to the programmers yang: ultimately, both are building symbolic structures grounded in language or language like formalism. The merger of the two will create an entirely new discipline.

This Week’s Links

No links this week — wasn’t reading enough and nothing that inspired me in the limited reading that I did.


If you like this post and want to receive others like this in your email, sign up for the weekly newsletter

Email Address

Sign Up

I take your privacy very seriously. Your email will remain private

Thank you!

Leave a Reply