• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar
  • Skip to footer

LispCast

Making the world safe for Functional Programming

  • Hire Eric
  • Podcast
  • Essays
  • About

What is the primary superpower of functional programmers?

Eric Normand · Updated January 15, 2019

https://lispcast.com/podcast-player/1385/what-is-the-primary-superpower-of-functional-programmers.mp3

Download file | Play in new window | Duration: 00:05:20 | Recorded on July 26, 2018

Is there something that functional programmers do that, without that, you couldn’t really call them a functional programmer? Is there a power that all other powers are dependent on?

Transcript

Eric Normand: What is the primary superpower of the functional programmer? Hello, my name is Eric Normand. These are my thoughts on functional programming.

I’m organizing this book and my editor asked me a really good question, it’s just a prompt to help me think about my material. The question was, “What are the superpowers that you need to teach? What ability or skills are people going to have after they finished the chapter, the book, the section?”

I’ve been thinking a lot about the superpowers. What’s the most important one? How do you organize these superpowers to be taught?

The primary superpower, as far as I can see…The primary meaning it’s fundamental. The other ones all stem on this one. The primary superpower is the ability to see actions, calculations and data, so real quick. I have other episodes on what these are. I could spend a whole hour talking about the difference between actions, calculations and data, but real quick.

Actions are things that affect the world and are bound in time. That’s how you tell that they’re an action. It depends on when you run it or how many times you’ve run it. If you send an email twice, that’s different from sending that email one time, and it’s different from sending it zero times. That’s actions.

Actions are things that affect the world and are bound in time. That's how you tell that they're an action. It depends on when you run it or how many times you've run it. If you send an email twice, it's different from sending it one time of zero times.https://t.co/dDSdNUHa10

— Eric Normand (@ericnormand) December 26, 2018

Calculations, you can carve out parts of your program that don’t matter when they’re run or how many times they’ve run. All the additions that you do in your program, when you add two numbers, that doesn’t matter when you do it, because you’re going to get the same answer no matter what.

Inside of that, there’s data. Data definitely doesn’t matter when you run them. I mean you don’t run them. They’re inert. They can’t be run. What they can be is interpreted. In general, we’re dealing with immutable data, data you don’t change.

Data is timeless in a deeper way than calculations are, because calculations do require you to run them at some time to use them, whereas data is just inert. It just sits there and regardless of whether you to read it or not, it's going to be there.https://t.co/3JeTk6B9MR

— Eric Normand (@ericnormand) December 23, 2018

It’s timeless in a deeper way than calculations are, because calculations do require you to run them at some time to use them, whereas data is just inert. It just sits there and regardless of whether you to read it or not, it’s going to be there.

The ability to see these things, to distinguish between them, is very important in functional programming. You need to be able to see that this action depends on time, or this part of my code is timeless, and I can run this as many times as I want. That’s the primary superpower. If a programmer couldn’t do that, I couldn’t call them a functional programmer. That is very important.

The ability to distinguish between actions, calculations, and data is very important in FP. You need to see that some code depends on time, or other code is timeless, and I can run this as many times as I want. That's the primary superpower.https://t.co/Uq7ynIOTN1

— Eric Normand (@ericnormand) December 10, 2018

I’ve really been thinking about whether that’s true, whether this is primary. I can’t imagine a Haskell programmer who couldn’t do this. I couldn’t imagine a Clojure programmer who couldn’t do this. This is just basic to every other skill.

You cannot identify that this part of the code is going to have a side-effect. That “It depends on how many times I run it” versus “This other part is a pure function, I can call it as many times as I want” versus, “This is just some data that I’m going to interpret in different ways, in different situations.”

I think that I’m on to something, but I need your help to let me know that this is make sense. I would love to hear that it doesn’t, because I’m writing this book and I don’t want to put this in there if it doesn’t make sense. Is there something even more fundamental than that? I think it makes sense, what I’m wondering if it is primary.

Please, if you have any thoughts on this, you can reach me on Twitter @ericnormand. I’m also eric@lispcast.com on my email. Thank you so much. I’ll see you later.

Published August 6, 2018 · Filed Under: Thoughts on Functional Programming Podcast by Eric Normand ·

Eric Normand

Eric Normand is an experienced functional programmer, trainer, speaker, writer, and consultant on all things FP. He started writing Lisp in 2000 and is now a Clojure expert, producing the most comprehensive suite of Clojure training material at PurelyFunctional.tv. He has a popular Clojure newsletter and blog. He also consults with companies to use functional programming to better serve business objectives. You can find him speaking internationally at programming conferences.

Related Posts

  • What are side-effects?
    In functional programming, people often use the term si...
    Read more
  • What are concurrency and parallelism?
    What are concurrency and parallelism? What's the differ...
    Read more
  • What are race conditions?
    What is a race condition? We look at what causes race c...
    Read more
  • What are pure functions?
    What are pure functions? I explore the definition, the ...
    Read more

 

Receive a weekly email to inspire functional programmers.

Subscribe for Free

Primary Sidebar

Please leave a review on iTunes.

Subscribe

RSS
iTunes

Recent Episodes

  • What are side-effects?
  • What are concurrency and parallelism?
  • What are race conditions?
  • What are pure functions?
  • How to apply the Onion Architecture

PROFESSIONAL SERVICES

                  Hire Eric

  • Speaking
  • Consulting
  • Training

KEEP IN TOUCH WITH ERIC NORMAND

  • Email
  • Github
  • Linkedin
  • Phone
  • Twitter
  • YouTube

Footer

  • Email
  • Github
  • Linkedin
  • Phone
  • Twitter
  • YouTube

Professional Services

  • Speaking
  • Consulting
  • Training

Content

  • Essays
  • Podcast
  • Presentations

Copyright © 2019 Eric Normand