29

Q: Why do anarchists always use functional programming?

A: Because it has no state.

*bum tiss*

Comments
  • 2
    what do Haskell and "capital" by Marx have in common?

    - No class

    - No state
  • 5
    My favourite rendition of this joke, unfortunately I don't own the book
  • 0
    My functional React component has state...
  • 2
    Wow, a good joke in the joke category. What a surprise!
  • 0
    @fullstackchris Function components are the same as class components, the only difference is that now we can replace the single language-defined state mechanism with a single library-defined state mechanism.

    It would've cost nothing to pass the hooks API to the functional components as an object, and it would've been so much more flexible.
  • 1
    Hmm I’ve always seen functional programming as a special way of working with state. Not the absence of state.

    Like in functional programming you typically apply functions to state in order to create new state as the output.
    Opposed to modifying the state as a side effect of a function call of an object.

    Maybe I’m confusing state with data.
  • 1
    @Lensflare These terms are fluid, a monad is typically considered to have state, but even if you're using CPS to represent side effects the instruction pointer is still without doubt a form of state.
  • 0
    @Lensflare A distinct property of state (in the context of object-oriented programming) in my opinion is that it's mutable and not copyable, that is, there may be operations that you can't undo. In FP though, operations are very flexible and you have many options for what you allow, so from that viewpoint these constraints feel a lot more arbitrary when we have things like comonads.
Add Comment