<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Riley Moher on Medium]]></title>
        <description><![CDATA[Stories by Riley Moher on Medium]]></description>
        <link>https://medium.com/@riley.momo?source=rss-bf5ad4d3285a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*bCfqRNR-1ImKp_6If-lZnQ.jpeg</url>
            <title>Stories by Riley Moher on Medium</title>
            <link>https://medium.com/@riley.momo?source=rss-bf5ad4d3285a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 20:19:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@riley.momo/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Are Programmers Philosophers in Disguise?]]></title>
            <link>https://medium.com/better-programming/programmers-are-philosophers-in-disguise-b6ece762b984?source=rss-bf5ad4d3285a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6ece762b984</guid>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[philosophy]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[work]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Riley Moher]]></dc:creator>
            <pubDate>Tue, 09 Aug 2022 13:40:27 GMT</pubDate>
            <atom:updated>2022-08-09T15:35:00.460Z</atom:updated>
            <content:encoded><![CDATA[<h4>The Curry-Howard correspondence for beginners</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bGRxCvXNYLTCTSshWDYXaA.png" /><figcaption>Images from Unsplash (<a href="https://unsplash.com/photos/mZnx9429i94">left</a>, <a href="https://unsplash.com/photos/7NzP4i_ej1U">right</a>)</figcaption></figure><p>What do programming and philosophy have in common? A lot more than you think. This article will explain, in beginner-friendly terms, exactly how that relationship looks and how it was discovered. I’ll break down this concept into four sections:</p><p>· <a href="#a8e2">Logic: the Key to Philosophy and Programming</a><br>· <a href="#0ca8">Propositions as Types</a><br>· <a href="#7674">Proofs as Programs</a><br>· <a href="#b222">What it Means for Programmers</a></p><h3>Logic: The Key to Philosophy and Programming</h3><p>The key piece in connecting philosophy and programming is logic. In the fourth century BCE, Aristotle created a kind of logic that would form the foundation for all logic to follow, built on propositions and conclusions.</p><blockquote>Proposition: All men are mortal.</blockquote><blockquote>Proposition: All greeks are men.</blockquote><blockquote>Conclusion: All greeks are mortal.</blockquote><p>Propositions are facts that we propose are true, and the conclusions we can conclude to be true after considering all the propositions together.</p><p>Over the following centuries, these ideas would be built on and evolve into new kinds of logic, allowing for more sophisticated propositions and conclusions to be made and eventually creating modern mathematics as we know it today.</p><p>In the 1930s, logic continued to evolve, but a new area of science was now being explored: computer science. Over the next 30 years, two scientists would come to a conclusion that would forever change math and computer science:</p><blockquote>Mathematical logic and computer programs are equal!</blockquote><p>These two individuals were the mathematician Haskell Curry and the Logician William Alvin Howard, and their discovery is named the Curry-Howard-Correspondence.</p><p>So, what exactly is the Curry-Howard correspondence and how does it tell us that logic and programs are equal? To answer this question, we’ll look at two relationships: propositions and types and proofs and programs.</p><h3>Propositions as Types</h3><p>Logical propositions allow us to state knowledge about the world around us, and proofs tell us whether or not that knowledge is accurate. The Curry-Howard correspondence tells us that we can also state that knowledge with <a href="https://betterprogramming.pub/how-a-barber-founded-computer-science-175c1c458794">computer types</a> and prove it using computer programs. To demonstrate this in action, consider this simple math problem:</p><blockquote>Hello + 5 = ?</blockquote><p>If you think this is a silly question, you’re right! But why doesn’t it make sense? Well, when we use the + symbol, we expect to add together two numbers, and the word “hello” is not a number. We might state this with a logical proposition saying:</p><blockquote>For any two things being added together, those two things are numbers.</blockquote><p>The Curry-Howard correspondence tells us we can say the same thing using types. In this case, we’re giving the type of the addition function.</p><p>The addition is a function that takes two numbers as input and returns a new number as output.</p><pre>Function Plus<br>Input : Number, Number<br>Output : Number</pre><p>This is called the function’s type signature — it identifies the function, just as your signature would identify you.</p><p>So, now that we have our logical proposition and our computer type, we can use the Curry-Howard correspondence to show that hello + 5 doesn’t make sense with logical proof and a computer program.</p><h3>Proofs as Programs</h3><p>Let’s start with the logical side:</p><blockquote>For any two things being added together, those two things are numbers.</blockquote><p>In our example of <em>hello + 5</em>, we have two things being added together:</p><ul><li>“hello”</li><li>5</li></ul><p>Our proposition tells us that both of the things being added together are numbers, and our statement tells us something different: that only one of them is a number — which is logically inconsistent.</p><p>So, we’ve used logic to show why our statement doesn’t make sense — now we can use a computer program to do the same thing.</p><p>Remember our function has this type signature:</p><pre>Function Plus<br>Input : Number, Number<br>Output : Number</pre><p>So, what happens when we try our function with our inputs of hello and 5?</p><pre>&gt; Hello + 5 <br>Type Error: Expected type &quot;Number&quot;, recieved type &quot;String&quot;</pre><p>Our program fails to run, giving us a type error. Before trying to add together our inputs, the computer checked the types of the inputs. We call this type-checking, and it ran into a problem: it failed to type-check.</p><p>So, both logic and the computer told us hello + 5 doesn’t make sense with a logical inconsistency and a type error. With the Curry-Howard correspondence, we know this isn’t a coincidence and that, in fact, the logic and the program are doing the same thing.</p><h3>What It Means for Programmers</h3><p>While showing that hello + 5 doesn’t make sense isn’t exactly a revolutionary result. The Curry-Howard correspondence is critical to research in programming and philosophy.</p><p>The Curry-Howard correspondence allows computer scientists, mathematicians, and philosophers to use the same language and work together to make new software, theories, and frameworks.</p><p>When types, logical theories, and programs become more complex, the implications of the Curry-Howard correspondence can be used to create sophisticated models and prove the properties of programs.</p><p>Learning the foundations of computer science is important to becoming a better programmer. If you want to learn more about these fundamental computer science concepts in a beginner-friendly way, stay tuned for my future articles covering type theory and functional programming.</p><h3><strong>References</strong></h3><ol><li><a href="https://www.dcc.fc.up.pt/~acm/howard2.pdf">Howard, William A. “The formulae-as-types notion of construction.” <em>To HB Curry: essays on combinatory logic, lambda calculus and formalism</em> 44 (1980): 479–490.</a></li><li><a href="https://www.xn--pdrot-bsa.fr/slides/inria-junior-02-15.pdf">Pédrot, Pierre-Marie. “The Curry-Howard isomorphism for dummies.” (2015)</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6ece762b984" width="1" height="1" alt=""><hr><p><a href="https://medium.com/better-programming/programmers-are-philosophers-in-disguise-b6ece762b984">Are Programmers Philosophers in Disguise?</a> was originally published in <a href="https://betterprogramming.pub/">Better Programming</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How a Barber Founded Computer Science]]></title>
            <link>https://medium.com/better-programming/how-a-barber-founded-computer-science-175c1c458794?source=rss-bf5ad4d3285a------2</link>
            <guid isPermaLink="false">https://medium.com/p/175c1c458794</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Riley Moher]]></dc:creator>
            <pubDate>Thu, 28 Jul 2022 13:02:58 GMT</pubDate>
            <atom:updated>2022-07-28T13:02:58.799Z</atom:updated>
            <content:encoded><![CDATA[<h4>An introduction to the origins of type theory</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W2iHdbNCDzB_B6Hd6Hqyzg.png" /><figcaption>Image Drawn by <a href="https://medium.com/@elisatychang">Elisa Chang</a></figcaption></figure><p>“What does a barber have to do with computer science?” You’re probably asking yourself. Whether you’re curious about computer science or already a seasoned computer scientist, this article will not only answer that question, but it will also teach you the origins of an integral part of computer science: types.</p><p>To introduce the titular barber, consider the following riddle:</p><blockquote>There is one barber in town. This barber shaves everyone who does not shave themselves, and no one else. Does the barber shave himself?</blockquote><p>To better understand how we should approach this problem — and why it matters — we’ll first get into the basic philosophy of types.</p><h3>What Type of Thing Is That?</h3><p>To understand the world around us, we draw all kinds of identifying lines between different things: whether species of animals, magnitudes of earthquakes, or sizes of cities. There are apparent and distinct types of things that exist in the world around us. A dog is obviously different from a human, which are both different from a tree.</p><p><em>But how do we make these distinctions concrete and specific enough for a computer to understand them?</em></p><p>A simple approach is to define sets of things and establish relationships between those sets. You can think of sets as containers or buckets with labels on them — kind of like a category. For example, we could create some basic sets of the animal kingdom like so:</p><figure><img alt="A venn diagram depicting a yellow circle entitled mammals, and a blue circle entitled sea creatures. In the yellow mammals circle is a red circle entitled humans, and in the overlap of the mammals and sea creatures circle is a green circle entitled dolphins." src="https://cdn-images-1.medium.com/max/501/1*bHasedO-N2ur_tz13AmPzQ.png" /><figcaption>Source: Image by the Author</figcaption></figure><p>While this may seem simple, this organization of concepts already gives us some handy capabilities. For example, if I know that my friend Bob is a Human, then I also know that Bob must be a mammal. By putting sets inside other sets, I can describe a hierarchical relationship. Similarly, I can describe how dolphins are both sea creatures <em>and</em> mammals. By overlapping sets, I can describe concepts that have traits in common with multiple concepts.</p><h3>The Trouble With Sets and the Answer to the Riddle</h3><p>However, sets do have some significant limitations. This is where we return to our barber. Recall our original riddle:</p><blockquote>There is one barber in town. This barber shaves everyone who does not shave themselves, and no one else. Does the barber shave himself?</blockquote><p>Okay, let’s break this down. If we were to ask a random person off the street in this town, “do you shave yourself?” and they reply “no,” then we know the barber must shave them. However, what if we ask the barber this same question?</p><p>If the barber says yes — he does shave himself, and since we know the barber doesn’t shave anyone who shaves themselves, the barber does not shave himself.</p><p>If the barber says no — he does not shave himself, and since we know the barber shaves all those who shave themselves, the barber does shave himself.</p><blockquote>The barber shaves himself and he doesn’t shave himself?</blockquote><p>Clearly, something in our setup doesn’t make sense. Aany problem which leads to these kinds of contradictions is what we call a paradox.</p><p>This particular paradox, however, isn’t just any random brainteaser — it is one of the most important problems in the history of computer science and mathematics. It was discovered in 1901 by famous British mathematician Bertrand Russel and is called Russel’s Paradox. The barber’s paradox is Russel’s way of expressing this problem he discovered in set theory in a way that could be commonly understood.</p><h3>If Not Sets, Then What?</h3><p>Building a system on top of a theory that can allow contradictions like Russel’s paradox will lead to all sorts of problems, so what can we do instead?</p><p>The essential problem of sets that leads to this paradox is that sets may be described through other sets, including themselves.</p><p>Russel, trying to solve these problems, began to add restrictions to sets, giving them more order. This order came in the form of specific rules about how these new and more complex sets should be allowed to interact with each other. In mathematics and type theory, we call these rules axioms.</p><p>Over time, as computer scientists argued and collaborated, these axioms evolved, and simple sets became complex types. Type theory would evolve over the years, and indeed it still does. Modern programming languages today rely on type theory — to make a distinction between a zip code and a first name or to figure out how many decimal points to keep when doing complex calculations.</p><p>Some examples of types in modern programming languages are integers: numbers with no decimal places, and strings: text-like sentences or even entire books.</p><p>However, what many computer scientists may not know when using strings, integers, or other complex types is that they all come from one very important barber.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=175c1c458794" width="1" height="1" alt=""><hr><p><a href="https://medium.com/better-programming/how-a-barber-founded-computer-science-175c1c458794">How a Barber Founded Computer Science</a> was originally published in <a href="https://betterprogramming.pub/">Better Programming</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>