<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Contracts on Hillel Wayne</title>
    <link>https://www.hillelwayne.com/tags/contracts/</link>
    <description>Recent content in Contracts on Hillel Wayne</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 08 Apr 2019 00:00:00 +0000</lastBuildDate>
    
	<atom:link href="https://www.hillelwayne.com/tags/contracts/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>Finding Property Tests</title>
      <link>https://www.hillelwayne.com/post/contract-examples/</link>
      <pubDate>Mon, 08 Apr 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.hillelwayne.com/post/contract-examples/</guid>
      <description>A while back I was ranting about APLs and included this python code to get the mode of a list:
def mode(l): max = None count = {} for x in l: if x not in count: count[x] = 0 count[x] += 1 if not max or count[x] &amp;gt; count[max]: max = x return max  There&amp;rsquo;s a bug in it. Do you see it? If not, try running it on the list [0, 0, 1]:</description>
    </item>
    
    <item>
      <title>We&#39;ve Already Thought the Unthinkable</title>
      <link>https://www.hillelwayne.com/post/thinking-the-unthinkable/</link>
      <pubDate>Fri, 09 Feb 2018 00:00:00 +0000</pubDate>
      
      <guid>https://www.hillelwayne.com/post/thinking-the-unthinkable/</guid>
      <description>I recently read Tomas Petricek&amp;rsquo;s Thinking the Unthinkable, where he argues that modern PLT makes several restrictive assumptions about the nature of programming. Our reliance on mathematics in CS is not fundamental and our obsession with formal logic and algorithms keeps us from seeing other possible paradigms. He proposes two other unthinkable paradigms that are unrelatable to modern mathematical programming.
I disagree with his premises: I think there&amp;rsquo;s a very valid reason to ground aspects of programming in mathematics.</description>
    </item>
    
    <item>
      <title>Property Tests &#43; Contracts = Integration Tests</title>
      <link>https://www.hillelwayne.com/post/pbt-contracts/</link>
      <pubDate>Sun, 17 Dec 2017 00:00:00 +0000</pubDate>
      
      <guid>https://www.hillelwayne.com/post/pbt-contracts/</guid>
      <description>I&amp;rsquo;m a pretty big fan of contracts and property-based testing. While they&amp;rsquo;re both powerful, they do have tradeoffs:
 Contracts are simple and allow for complex conditionals, but you need to test them over a wide space to confirm them. Property-Based Testing can test your code over a very wide search space, but you have to come up with good generators and invariants.  Maybe they complement each other: &amp;ldquo;your code doesn&amp;rsquo;t violate any contracts&amp;rdquo; counts as a PBT invariant.</description>
    </item>
    
    <item>
      <title>Introduction to Contract Programming</title>
      <link>https://www.hillelwayne.com/post/contracts/</link>
      <pubDate>Mon, 27 Nov 2017 00:00:00 +0000</pubDate>
      
      <guid>https://www.hillelwayne.com/post/contracts/</guid>
      <description>I&amp;rsquo;ve namedropped contracts enough here that I think it&amp;rsquo;s finally time to go talk about them. A lot of people conflate them with class interfaces / dynamic typing / &amp;ldquo;your unit tests are your contract&amp;rdquo;, which muddies the discussion and makes it hard to show their benefits. So I&amp;rsquo;d like to build up the idea of contracts from first principles. We&amp;rsquo;re going to work in Python, up until the point where things get crazy.</description>
    </item>
    
  </channel>
</rss>