Podbean logo
  • Discover
  • Podcast Features
    • Podcast Hosting

      Start your podcast with all the features you need.

    • Podbean AI Podbean AI

      AI-Enhanced Audio Quality and Content Generation.

    • Blog to Podcast

      Repurpose your blog into an engaging podcast.

    • Video to Podcast

      Convert YouTube playlists to podcasts, videos to audios.

  • Monetization
    • Ads Marketplace

      Join Ads Marketplace to earn through podcast sponsorships.

    • PodAds

      Manage your ads with dynamic ad insertion capability.

    • Apple Podcasts Subscriptions Integration

      Monetize with Apple Podcasts Subscriptions via Podbean.

    • Live Streaming

      Earn rewards and recurring income from Fan Club membership.

  • Podbean App
    • Podcast Studio

      Easy-to-use audio recorder app.

    • Podcast App

      The best podcast player & podcast app.

  • Help and Support
    • Help Center

      Get the answers and support you need.

    • Podbean Academy

      Resources and guides to launch, grow, and monetize podcast.

    • Podbean Blog

      Stay updated with the latest podcasting tips and trends.

    • What’s New

      Check out our newest and recently released features!

    • Podcasting Smarter

      Podcast interviews, best practices, and helpful tips.

  • Popular Topics
    • How to Start a Podcast

      The step-by-step guide to start your own podcast.

    • How to Start a Live Podcast

      Create the best live podcast and engage your audience.

    • How to Monetize a Podcast

      Tips on making the decision to monetize your podcast.

    • How to Promote Your Podcast

      The best ways to get more eyes and ears on your podcast.

    • Podcast Advertising 101

      Everything you need to know about podcast advertising.

    • Mobile Podcast Recording Guide

      The ultimate guide to recording a podcast on your phone.

    • How to Use Group Recording

      Steps to set up and use group recording in the Podbean app.

  • All Arts Business Comedy Education
  • Fiction Government Health & Fitness History Kids & Family
  • Leisure Music News Religion & Spirituality Science
  • Society & Culture Sports Technology True Crime TV & Film
  • Live
  • How to Start a Podcast
  • How to Start a Live Podcast
  • How to Monetize a podcast
  • How to Promote Your Podcast
  • How to Use Group Recording
  • Log in
  • Start your podcast for free
  • Podcasting
    • Podcast Features
      • Podcast Hosting

        Start your podcast with all the features you need.

      • Podbean AI Podbean AI

        AI-Enhanced Audio Quality and Content Generation.

      • Blog to Podcast

        Repurpose your blog into an engaging podcast.

      • Video to Podcast

        Convert YouTube playlists to podcasts, videos to audios.

    • Monetization
      • Ads Marketplace

        Join Ads Marketplace to earn through podcast sponsorships.

      • PodAds

        Manage your ads with dynamic ad insertion capability.

      • Apple Podcasts Subscriptions Integration

        Monetize with Apple Podcasts Subscriptions via Podbean.

      • Live Streaming

        Earn rewards and recurring income from Fan Club membership.

    • Podbean App
      • Podcast Studio

        Easy-to-use audio recorder app.

      • Podcast App

        The best podcast player & podcast app.

  • Advertisers
  • Enterprise
  • Pricing
  • Resources
    • Help and Support
      • Help Center

        Get the answers and support you need.

      • Podbean Academy

        Resources and guides to launch, grow, and monetize podcast.

      • Podbean Blog

        Stay updated with the latest podcasting tips and trends.

      • What’s New

        Check out our newest and recently released features!

      • Podcasting Smarter

        Podcast interviews, best practices, and helpful tips.

    • Popular Topics
      • How to Start a Podcast

        The step-by-step guide to start your own podcast.

      • How to Start a Live Podcast

        Create the best live podcast and engage your audience.

      • How to Monetize a Podcast

        Tips on making the decision to monetize your podcast.

      • How to Promote Your Podcast

        The best ways to get more eyes and ears on your podcast.

      • Podcast Advertising 101

        Everything you need to know about podcast advertising.

      • Mobile Podcast Recording Guide

        The ultimate guide to recording a podcast on your phone.

      • How to Use Group Recording

        Steps to set up and use group recording in the Podbean app.

  • Discover
  • Log in
    Sign up free
Functional Design in Clojure

Functional Design in Clojure

Technology:Software How-To

Ep 112: Purify!

Ep 112: Purify!

2024-02-22
Download Right click and do "save link as"

Each week, we discuss a different topic about Clojure and functional programming.

If you have a question or topic you'd like us to discuss, tweet @clojuredesign, send an email to feedback@clojuredesign.club, or join the #clojuredesign-podcast channel on the Clojurians Slack.

This week, the topic is: "pure data, pure simplicity". We loop back to our new approach and find more, and less, than we expected!

Our discussion includes:
  • Sportify reaches the end zone!
  • How can you make software extremely reliable?
  • How can you keep logic pure when it depends on the outcome of I/O?
  • What is the "think, do, assimilate" pattern?
  • What is a "context"? What information should it contain?
  • What is an "operation"? What information should it contain?
  • Why does "structural sharing" matter?
  • When to use multimethods vs case statements.
  • The benefits of reducing functions.
  • Testing with mocks vs data.
  • Why test with real-world data?
  • How does minimizing I/O make your code testable, inspectable, and repeatable?
  • How to support any process conditional.
  • A general way to model any process.
Selected quotes
  • Let's get some Hammock Time. We're big fans of Hammock Time!

  • We make a function for each of those: think, do, assimilate. A function to figure out the next thing, a function to do it, and a function to integrate the results back into the context. ("determine-operation", "execute-operation", and "update-context".)

  • It's not a single point of failure! It's a single point of context.

  • Where you have a binding in a let block, you have a key in a context map. There's a symmetry there.

  • You can make the operation map as big, fat, and thick as you want, so "execute-operation" has 100% of everything it needs for that operation.

  • The "determine-operation" function can decide anything because it has the full context—the full world at its disposal!

  • Clojure has structural sharing, so all the information is cheap. We can keep a bunch of references to it in memory. We're not going to run out of memory if we keep information about every step.

  • The "update-context" is a reducer, so we can make a series of fake results in our test and run through different scenarios using "determine-operation" and "update-context". We're able to test all of our logic in our test cases because we can just pass in different types of data.

  • Your tests are grounded in reality. They're grounded in what has happened.

  • We've aggressively minimized the side effects down to the tiniest thing possible!

  • Data is inert. Mocks are not. Mocks are behavior.

  • You can just literally copy from the exception and put it in your test. There's no need transform it. It is already useful.

  • It's very testable. It's very inspectable. It's very repeatable. It creates a really simple overall loop.

  • You want those I/O implementations so small and dumb that the only way to mess them up is if you're calling the wrong function or you're passing the wrong args. Once it works, it will always work, and you no longer have to test it.

  • We need to build into context every little bit of information we need to know to make a decision.

  • Context takes anything that is implicit and makes it 100% explicit, because you can't get data across the boundaries without putting it in the context. You have no option but to put everything in the context, so you know everything that's going on.

  • We're in this machine, and there's no exit. We're on the freeway, and there's no off-ramp. We're in the infinite loop! How do we know we're done?

  • How do we know we're done?

Links
  • Sportify! series:
    • Ep 101: Sportify!
    • Ep 102: REPLify!
    • Ep 103: Explorify!
    • Ep 104: Assembleify!
    • Ep 105: Codify!
    • Ep 106: Robustify!
    • Ep 107: Idempotify!
    • Ep 108: Testify!
    • Ep 109: Extractify!
    • Ep 110: Contextify!
    • Ep 111: Loopify!
  • "Hammock Driven Development" by Rich Hickey
  • core.async
  • Portal
view more

More Episodes

Ep 118: Pure Parts
2024-06-27
Ep 117: Pure Understanding
2024-05-23
Ep 116: The Main Focus
2024-05-16
Ep 115: The Main Event
2024-05-09
Ep 114: Brand New, Again
2024-05-02
Ep 113: Highlightify!
2024-02-29
Ep 111: Loopify!
2024-02-15
Ep 110: Contextify!
2024-02-08
Ep 109: Extractify!
2024-02-01
Ep 108: Testify!
2024-01-25
Ep 107: Idempotify!
2024-01-18
Ep 106: Robustify!
2024-01-11
Ep 105: Codify!
2024-01-04
Ep 104: Assembleify!
2023-12-21
Ep 103: Explorify!
2023-12-14
Ep 102: REPLify!
2023-12-07
Ep 101: Sportify!
2023-11-30
Ep 100: Thanks Overflow
2023-11-23
Ep 099: REPL Your World
2023-11-16
  • ←
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • →
01234578910111213141516171819

Get this podcast on your
phone, FREE

Download Podbean app on App Store Download Podbean app on Google Play

Create your
podcast in
minutes

  • Full-featured podcast site
  • Unlimited storage and bandwidth
  • Comprehensive podcast stats
  • Distribute to Apple Podcasts, Spotify, and more
  • Make money with your podcast
Get started

It is Free

  • Podcast Services

    • Podcast Features
    • Pricing
    • Enterprise Solution
    • Private Podcast
    • The Podcast App
    • Live Stream
    • Audio Recorder
    • Remote Recording
    • Podbean AI
  •  
    • Create a Podcast
    • Video Podcast
    • Start Podcasting
    • Start Radio Talk Show
    • Create a Podcast for Spotify
    • Education Podcast
    • Church Podcast
    • Get Sermons Online
    • Free Audiobooks
  • MONETIZATION & MORE

    • Podcast Advertising
    • Dynamic Ads Insertion
    • Apple Podcasts Subscriptions
    • AI Podcast Creator
    • Blog to Podcast
    • YouTube to Podcast
    • Submit Your Podcast
    • Switch to Podbean
    • Podbean Plugins
  • KNOWLEDGE BASE

    • How to Start a Podcast
    • How to Start a Live Podcast
    • How to Monetize a Podcast
    • How to Promote Your Podcast
    • Mobile Podcast Recording Guide
    • How to Use Group Recording
    • Podcast Advertising 101
  • Support

    • Support Center
    • What’s New
    • Free Webinars
    • Podcast Events
    • Podbean Academy
    • Podbean Amplified Podcast
    • Badges
    • Resources
    • Developers
  • Podbean

    • About Us
    • Podbean Blog
    • Careers
    • Press and Media
    • Green Initiative
    • Affiliate Program
    • Contact Us
  • Privacy Policy
  • Cookie Policy
  • Terms of Use
  • Consent Preferences
  • Copyright © 2015-2026 Podbean.com