Clean Code: Functional Programming
58. Functional Programming and SOLID
By Robert C. Martin, 1h 13m

Fifty-eight. 58 is 2*29 and is the sum of the first seven prime numbers: 2+3+5+7+11+13+17. 58 is the year that Sputnik was launched. "Fifty-eight is like, the luckiest number ever," according to Patrick on SpongeBob SquarePants.

And...Episode 58 is where we talk about the SOLID principles in Functional Programs.


In the last episode—Episode 57 (which is 3*19 and the atomic number of Lanthanum (not to be confused with gold-pressed Latinum))—I told you we were done with Star Wars. I lied. Well, no, I didn't exactly lie. I was wrong, but I didn't know it at the time.

You see, at the time I knew I wanted to do an episode on the SOLID principles in functional programming. I just didn't know I was going to be using Star Wars as the example. But then, as I started writing the episode, it became clear to me that there were loads and loads of SOLID principle conformance and violation in Star Wars.

Anyway, Star Wars it is. One more time. And this time we're going to look at it from the point of view of:

  • SRP - The Single Responsibility Principle,
  • OCP - The Open-Closed Principle,
  • LSP - The Liskov Substitution Principle,
  • ISP - The Interface Segregation Principle, and
  • DIP - The Dependency Inversion Principle.

As an aside, did you know that twenty years ago there was a guy on USENET who accused me of being a racist for using the word "segregation" in the ISP?

57. Functional Programming Spacewar Game Logic
By Robert C. Martin, 1h 7m


These are a few of the questions I want to address:


  2. How does Clojure/spec help us keep our data types under control in a dynamically-typed language? Are dynamically-typed functional languages inherently weaker than statically-typed functional languages? Or are there advantages to dynamic typing?


  4. Lazy evaluation is a powerful technique, but what kind of trouble can it get you into?

  5. Where does this program go from here?

Prepare yourself for a really interesting, deep technical dive as we walk through Spacewar: Game Logic.

56. Functional Programming Spacewar Widgets and Specs
By Robert C. Martin, 1h 19m




55. Functional Programming Spacewar
By Robert C. Martin, 1h 27m





54. Functional Master Mind
By Robert C. Martin, 1h 7m





53. Introduction To Functional Programming
By Robert C. Martin, 1h 10m





