Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
While Ruby is object oriented and imperative, it does have some features that allow for functional programming. In this talk we'll compare Haskell, a functional programming language, with Ruby while exploring these common functional patterns: higher order functions, lazy evaluation, and memoization. Along the way we'll explore how Ruby works internally, find out whether it's a true functional language, and zoom in to take a close look at Ruby 2.0's implementation of the new "Enumerator::Lazy" feature. Help us caption & translate this video! http://amara.org/v/FG93/
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
The video titled 'Functional Programming and Ruby' presented by Pat Shaughnessy at the GoRuCo 2013 conference explores the intersection of functional programming principles with the Ruby programming language. While Ruby is primarily known as an object-oriented and imperative language, the talk highlights how it encompasses aspects of functional programming. Shaughnessy begins by showcasing Haskell, a purely functional programming language, to illustrate key concepts that are also relevant in Ruby. Key Points Discussed: - **Learning from Other Languages**: Emphasizes the importance of stepping outside the comfort zone of Ruby to understand different programming paradigms, drawing an analogy to learning human languages. - **Ruby’s Origins**: Describes the influences on Ruby's creation by its founder, Matz, noting inspirations from Smalltalk, Perl, and Lisp. - **Concept of Functional Programming**: Defines functional programming and focuses on pure functions that consistently produce the same output, emphasizing predictability and reliability in software design. - **Higher-Order Functions**: Introduces higher-order functions—functions that take other functions as arguments or return them. Examples in both Haskell and Ruby show their similarities in implementing this concept. - **Lazy Evaluation**: Explains Haskell’s lazy evaluation using infinite lists, demonstrating how Ruby 2.0's Lazy Enumerator provides similar functionality, albeit with more verbosity. - **Memoization**: Discusses memoization to cache results for efficiency, presenting examples in Haskell and Ruby to compare the implementations. Throughout the discussion, notable examples include the quicksort algorithm and the Fibonacci sequence, illustrating how concepts like higher-order functions and memoization can be utilized in both languages. In conclusion, while Ruby is not a purely functional language, it possesses functional programming characteristics that can enhance coding practices. Shaughnessy encourages developers to explore a variety of programming languages—functional or otherwise—to gain new perspectives that will enrich their Ruby programming experience. The video underlines Ruby’s capability to incorporate functional paradigms, encouraging an appreciation of its functional features alongside its foundational object-oriented structure.
Suggest modifications
Cancel