Functional Programming and Grokking Simplicity - Eric Normand
Aug 6, 2020
auto_awesome
Eric Normand, author of Grokking Simplicity, discusses the importance of learning fundamental concepts in functional programming and the challenges of integrating them into non-functional languages. The podcast also explores ClosureScript as the next iteration of programming, functional thinking and design, and the use of Datomic as an immutable database. Additionally, the concept of offloading procedural efforts with data and using an immutable database structure for the front end are discussed.
Functional programming can be done in languages like JavaScript, but using a functional language like Haskell or Clojure provides a more immersive experience.
Functional programming favors local state over global state and using immutable data helps avoid the pitfalls of mutable state.
Live coding enhances the coding experience by allowing programmers to see immediate results without the need for console logs and offers numerous benefits.
Deep dives
Functional programming and Eric Normand's book
Eric Normand is a prominent advocate of functional programming and the power of functional thinking. His book, 'Grocking Simplicity,' breaks down functional design principles and introduces them to everyday programmers. The book, published by Manning Publications, is available through their Early Access program. Normand emphasizes the importance of understanding fundamental functional concepts before diving into more specialized areas.
Choosing a functional programming language
While functional programming can be done in languages like JavaScript, an immersive experience is best achieved in a functional language designed specifically for functional programming, such as Haskell or Clojure. Haskell offers a strict functional approach, focusing on calculations and pure functions. On the other hand, Clojure provides a dynamic and interactive experience, allowing for live coding and immediate feedback. The choice depends on personal preference and the desired features of the language.
State management in functional programming
Functional programming tends to use less mutable state and favors local state over global state. Using immutable data and local variables helps avoid the pitfalls of mutable state. While some libraries exist for managing state, such as Redux and Recoil, it is important to consider the locality of state before choosing a library. Redux, for example, is suitable for sharing state between components within a tab, while component state is best for managing state at a very local level. It is crucial to have a deeper understanding of the problem of state management and choose libraries accordingly.
The Importance of Live Coding and Real-time Feedback
Live coding allows programmers to see immediate results without the need for console logs. Instead of logging values, programmers can save them to variables and check the values as needed. This provides a live system that offers numerous benefits and greatly enhances the coding experience.
Understanding Actions, Calculations, and Data in Functional Programming
Functional programming involves more than just using mathematical functions. Immutable data, calculations (or pure functions), and actions (or impure functions) are fundamental concepts. Data is immutable, representing facts about events. Calculations are code that always produces the same output given the same input and is easier to test. Actions depend on when and how many times they are run and interact with the outside world. Distinguishing between these concepts is essential for effective functional programming.
Welcome back to The Virtual World. Today I was fortunate enough to sit down with Eric Normand, author of Grokking Simplicity, and download his thoughts on Functional Programming and, more importantly, Functional Design. I've got four free copies of his book to give away. Reach out to me on twitter @tytr_dev if you're interested.
You can check out his book on manning's website: https://www.manning.com/books/grokking-simplicity
Don't forget to use my discount code when buying things on their website for a 35% discount!
Discount code: podvworld20
Get the Snipd podcast app
Unlock the knowledge in podcasts with the podcast player of the future.
AI-powered podcast player
Listen to all your favourite podcasts with AI-powered features
Discover highlights
Listen to the best highlights from the podcasts you love and dive into the full episode
Save any moment
Hear something you like? Tap your headphones to save it with AI-generated key takeaways
Share & Export
Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more
AI-powered podcast player
Listen to all your favourite podcasts with AI-powered features
Discover highlights
Listen to the best highlights from the podcasts you love and dive into the full episode