The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,728 other followers

Robert C Martin – Functional Programming; What? Why? When? – YouTube

Posted by jpluimers on 2016/12/26

Great after X-mas watch: Robert C Martin – Functional Programming; What? Why? When? – YouTube subtitled “the failure of state”.

Thanks [WayBackAndrew Rohn – YouTube for the timestamp list:

  • 4:07 “Functional Programming: What? When? Why?” or “The Failure of State”
  • 5:10 Rich Hickey is the author of Clojure. Listen to his talks. 5:40 What is state? Variables.
  • 11:15 Structure and Interpretation of Computer Programs. This is a fascinating book. For the first 250 pages, the book uses no assignment statements.
  • 14:15 Here’s how SICP’s model of computing worked before they introduced an assignment statement. Simply replace a function call with its implementation.
  • 15:58 Once you introduce assignment. You can no longer replace a function call with its implementation. Why? Because the state of the system may have changed. An assignment statement introduces the concept of time.
  • 18:04 Side effect: an assignment statement. If there’s no assignment, there’s no side effect.
  • 20:22 What “hack” have we done to protect us from memory leaks? Garbage collection.
  • 31:46 Functional programming was invented in 1957 before OO and structured. But memory was too expensive to make it practical. But memory is cheap now.
  • 32:53 Should we change how we program? We should because: 1) Functional programs are simpler – which makes them easier to write and maintain 2) There’s no temporal coupling – no worrying if some function was called before another function. 3) Fewer concurrency issues. In a purely functional program, there’s no concurrency because there is no state. 4) No asking, “What’s the state?”
  • 38:38 We’re using multicore CPU’s now because we can’t increase clock rate anymore. And hardware makers are doing bizarre tradeoffs. They’re making individual processors slower but putting more processors in. So individual cores slow down but the chip throughput goes up if you can take advantage of all the cores.
  • 42:00 How are you going to work with an abundance of cores? Maybe we need to walk away from the assignment statement.
  • 49:49 OO = procedure + state. OO is exposed procedure but hidden state (encapsulation). It’s possible to write functional programs using an OO style. All of the objects become immutable.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: