Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Functional programming brings you not just fun, but also profit! Have you ever felt curious towards functional programming (FP)? Were you, soon afterwards, intimidated by the mystic terms like monads and functors? Do you think FP is not related to your Ruby work and thus, useless? Guess what–you can actually apply FP to your Ruby projects and reap benefits from it before fully understanding what a monad is! This talk will walk you through the powerful mental models and tools that FP gives us, and how we can readily use them to improve our apps in a language that we all love and understand.
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In her talk at RubyConf 2022, Jenny Shih explores the benefits of functional programming (FP) within Ruby projects, emphasizing that FP is not exclusively beneficial for languages traditionally associated with it, like Elixir. She clarifies misconceptions about FP while advocating for its significant advantages in writing cleaner, more reliable Ruby code. The main points of her presentation include: - **Functional Programming Basics**: Shih defines functional programming as a distinct programming paradigm focused on functions as the primary building blocks, differing from object-oriented programming (OOP) which encapsulates state and behavior within objects. - **Immutability**: A crucial concept in FP, immutability means that once a value is set, it cannot be changed. Shih stresses that immutability eliminates complexities associated with shared state, which can lead to unexpected bugs. She suggests tools such as the 'dry-struct' gem and Ruby 3.2’s data definitions for achieving immutability in Ruby. - **Pure Functions**: Shih explains that pure functions produce outputs strictly based on their inputs without causing side effects. This design principle minimizes complexities and enhances predictability in coding, helping developers avoid common pitfalls related to state mutations. - **Time Management and Concurrency**: The speaker discusses how functional programming tackles concurrency with greater efficacy than OOP. She shares an example from Elixir involving the actor model for concurrency, contrasting it with Ruby’s Global Interpreter Lock (GIL). Shih highlights Ruby 3.0's introduction of 'Ractor' as a step towards improving concurrency without shared state, enhancing efficiency further. Jenny's conclusion emphasizes that the integration of immutable data and pure functions leads to more reliable and maintainable code, encouraging Ruby programmers to adopt FP principles. She acknowledges that embracing a new paradigm requires practice and adaptation, providing resources for further exploration into functional programming. Overall, her message is one of empowerment for Ruby developers, demonstrating that they can benefit from FP without needing a complete mastery of its concepts right away.
Suggest modifications
Cancel