---
title: "Thoughts on \"Sprinkles of Functional Programming\" – WebRTC.ventures"
description: "At RailsConf 2019, we attended an interesting lecture called “Sprinkles of Functional Programming.” WebRTC Ventures aims to use the best approaches for our solutions, so I was excited for this lecture. The lecture discussed two concepts: object-oriented and functional programming."
image: https://blog.webrtc.ventures/hubfs/Imported_Blog_Media/Blog-Post.png
---

[Skip to content](https://blog.webrtc.ventures/2019/06/thoughts-on-sprinkles-of-functional-programming#main-content)

![WebRTC.ventures](https://blog.webrtc.ventures/hubfs/logo-main-light.svg)

- [WebRTC Services](https://webrtc.ventures/webrtc-development-services/)
  
  Show submenu for WebRTC Services 
  
    - [Assess](https://webrtc.ventures/services/assess/)
    - [Build](https://webrtc.ventures/services/build/)
    - [Integrate](https://webrtc.ventures/services/integrate/)
    - [Test](https://webrtc.ventures/services/test/)
    - [Manage](https://webrtc.ventures/services/manage/)
    - [Migrating From Twilio Video](https://webrtc.ventures/twilio-video/)
- Our Partners
  
  Show submenu for Our Partners 
  
    - [Amazon Chime SDK](https://webrtc.ventures/partners/amazon-chime-sdk/)
- Stories of Success
  
  Show submenu for Stories of Success 
  
    - [Remote Video Interpreting Platform with Agent Routing](https://webrtc.ventures/successes/remote-video-translation-platform/)
    - [WebRTC to SIP Gateway for ASL Interpreters](https://webrtc.ventures/successes/webrtc-to-sip-gateway-for-asl-interpreters/)
    - [Audio Listening Device to Improve Surgical Outcomes](https://webrtc.ventures/successes/audio-listening-device-to-improve-surgical-outcomes/)
    - [Albania’s First Telemedicine Platform](https://webrtc.ventures/successes/albanias-first-telemedicine-platform/)
    - [Automated Video Storytelling with the Amazon Chime SDK](https://webrtc.ventures/successes/automated-video-storytelling-with-the-amazon-chime-sdk/)
    - [Large Scale Video Conferencing](https://webrtc.ventures/successes/large-scale-video-conferencing/)
    - [Broadcasting and Webcast Control Room](https://webrtc.ventures/successes/live-video-broadcasting-and-webcast-control-room/)
- WebRTC Resources
  
  Show submenu for WebRTC Resources 
  
    - [WebRTC Live](https://webrtc.ventures/webrtc-live/)
    - [WebRTC Tips](https://www.youtube.com/playlist?list=PLayYqdnyegt3QvxX-Rt6wbFIK8727Z5Oz)
    - [WebRTC.ventures Blog](https://webrtc.ventures/blog/)
    - [Migrating From Twilio Video](https://webrtc.ventures/twilio-video/)
    - [WebRTC.ventures Training Program](https://webrtc.ventures/webrtc-ventures-training-program/)
- [About Us](https://webrtc.ventures/our-team/)
  
  Show submenu for About Us 
  
    - [Blog](https://webrtc.ventures/blog/)
    - [Our Team](https://webrtc.ventures/our-team/)
    - [Jobs](https://webrtc.ventures/jobs/)

Open main navigation

Close main navigation

- [WebRTC Services](https://webrtc.ventures/webrtc-development-services/)
  
  Show submenu for WebRTC Services 
  
    - [Assess](https://webrtc.ventures/services/assess/)
    - [Build](https://webrtc.ventures/services/build/)
    - [Integrate](https://webrtc.ventures/services/integrate/)
    - [Test](https://webrtc.ventures/services/test/)
    - [Manage](https://webrtc.ventures/services/manage/)
    - [Migrating From Twilio Video](https://webrtc.ventures/twilio-video/)
- Our Partners
  
  Show submenu for Our Partners 
  
    - [Amazon Chime SDK](https://webrtc.ventures/partners/amazon-chime-sdk/)
- Stories of Success
  
  Show submenu for Stories of Success 
  
    - [Remote Video Interpreting Platform with Agent Routing](https://webrtc.ventures/successes/remote-video-translation-platform/)
    - [WebRTC to SIP Gateway for ASL Interpreters](https://webrtc.ventures/successes/webrtc-to-sip-gateway-for-asl-interpreters/)
    - [Audio Listening Device to Improve Surgical Outcomes](https://webrtc.ventures/successes/audio-listening-device-to-improve-surgical-outcomes/)
    - [Albania’s First Telemedicine Platform](https://webrtc.ventures/successes/albanias-first-telemedicine-platform/)
    - [Automated Video Storytelling with the Amazon Chime SDK](https://webrtc.ventures/successes/automated-video-storytelling-with-the-amazon-chime-sdk/)
    - [Large Scale Video Conferencing](https://webrtc.ventures/successes/large-scale-video-conferencing/)
    - [Broadcasting and Webcast Control Room](https://webrtc.ventures/successes/live-video-broadcasting-and-webcast-control-room/)
- WebRTC Resources
  
  Show submenu for WebRTC Resources 
  
    - [WebRTC Live](https://webrtc.ventures/webrtc-live/)
    - [WebRTC Tips](https://www.youtube.com/playlist?list=PLayYqdnyegt3QvxX-Rt6wbFIK8727Z5Oz)
    - [WebRTC.ventures Blog](https://webrtc.ventures/blog/)
    - [Migrating From Twilio Video](https://webrtc.ventures/twilio-video/)
    - [WebRTC.ventures Training Program](https://webrtc.ventures/webrtc-ventures-training-program/)
- [About Us](https://webrtc.ventures/our-team/)
  
  Show submenu for About Us 
  
    - [Blog](https://webrtc.ventures/blog/)
    - [Our Team](https://webrtc.ventures/our-team/)
    - [Jobs](https://webrtc.ventures/jobs/)
- [Contact us](https://webrtc.ventures/contact/)

[Contact us](https://webrtc.ventures/contact/)

 Jun 4, 2019 12:00:00 AM

# Thoughts on "Sprinkles of Functional Programming"

[Alberto Gonzalez](https://blog.webrtc.ventures/author/alberto-gonzalez)

Share: [linkedin-in icon](http://www.linkedin.com/shareArticle?mini=true&url=https://blog.webrtc.ventures/2019/06/thoughts-on-sprinkles-of-functional-programming) [X Twitter icon](https://twitter.com/intent/tweet?url=https://blog.webrtc.ventures/2019/06/thoughts-on-sprinkles-of-functional-programming) [envelope icon](mailto:?body=https://blog.webrtc.ventures/2019/06/thoughts-on-sprinkles-of-functional-programming)

At RailsConf 2019, we attended an interesting lecture called “Sprinkles of Functional Programming.” WebRTC Ventures aims to use the best approaches for our solutions, so I was excited for this lecture. The lecture discussed two concepts: object-oriented and functional programming.

**Object-oriented programming** is a style that allows programmers to translate the behavior of things in real life to code that is understood by a computer. This presents concepts like class, object, inheritance, encapsulation, abstraction, and polymorphism.

**Functional programming** takes into account data and how it will change as we build our application. Many programming languages are specifically built-in to take advantage of this paradigm that “[handles symbolic computation and list processing applications](https://www.tutorialspoint.com/functional_programming/functional_programming_introduction.htm).”

After showing us different scenarios where object-oriented and functional programming may shine, lecturer John Schoeman took us on an imaginary journey creating a web app for a client.

## The Lecture

The lecture started by creating a new rails web app that stores products and allows its users to upload CSV files instead of manually creating them. Until this point, this is not far from what we see in our day-to-day developer lives.

Object-oriented and functional programming implementations diverge. First, we see the object-oriented implementation here:

![](https://blog.webrtc.ventures/hs-fs/hubfs/Imported_Blog_Media/Screen-Shot-2019-06-03-at-11_39_33-AM-1024x594.png?width=414&height=240&name=Screen-Shot-2019-06-03-at-11_39_33-AM-1024x594.png) ![](https://blog.webrtc.ventures/hs-fs/hubfs/Imported_Blog_Media/Screen-Shot-2019-06-03-at-11_39_33-AM-1024x594.png?width=414&height=240&name=Screen-Shot-2019-06-03-at-11_39_33-AM-1024x594.png)

And we see the functional programming implementation here:

![](https://blog.webrtc.ventures/hs-fs/hubfs/Imported_Blog_Media/Screen-Shot-2019-06-03-at-11_39_53-AM.png?width=287&height=151&name=Screen-Shot-2019-06-03-at-11_39_53-AM.png) ![](https://blog.webrtc.ventures/hs-fs/hubfs/Imported_Blog_Media/Screen-Shot-2019-06-03-at-11_39_53-AM.png?width=287&height=151&name=Screen-Shot-2019-06-03-at-11_39_53-AM.png)

As you can see here, the object-oriented implementation is all about behavior whereas the functional implementation is more about handling data.

The requirement changes and now the web app needs to allow Excel files to import.

Object-oriented implementation changes to a new class named ProductDataImporter, where we store the logic of the import functionality. The change in the code looks like the following:

![](https://blog.webrtc.ventures/hs-fs/hubfs/Imported_Blog_Media/Screen-Shot-2019-06-03-at-11_40_15-AM-818x1024-1.png?width=361&height=452&name=Screen-Shot-2019-06-03-at-11_40_15-AM-818x1024-1.png) ![](https://blog.webrtc.ventures/hs-fs/hubfs/Imported_Blog_Media/Screen-Shot-2019-06-03-at-11_40_15-AM-818x1024-1.png?width=361&height=452&name=Screen-Shot-2019-06-03-at-11_40_15-AM-818x1024-1.png)

Now the importer controller looks like this:

![](https://blog.webrtc.ventures/hs-fs/hubfs/Imported_Blog_Media/Screen-Shot-2019-06-03-at-11_40_43-AM.png?width=417&height=68&name=Screen-Shot-2019-06-03-at-11_40_43-AM.png) ![](https://blog.webrtc.ventures/hs-fs/hubfs/Imported_Blog_Media/Screen-Shot-2019-06-03-at-11_40_43-AM.png?width=417&height=68&name=Screen-Shot-2019-06-03-at-11_40_43-AM.png)

The functional programming changes are as follows:

![](https://blog.webrtc.ventures/hs-fs/hubfs/Imported_Blog_Media/Screen-Shot-2019-06-03-at-11_41_09-AM-1.png?width=397&height=301&name=Screen-Shot-2019-06-03-at-11_41_09-AM-1.png) ![](https://blog.webrtc.ventures/hs-fs/hubfs/Imported_Blog_Media/Screen-Shot-2019-06-03-at-11_41_09-AM-1.png?width=397&height=301&name=Screen-Shot-2019-06-03-at-11_41_09-AM-1.png)

And the read\_file function is now:

![](https://blog.webrtc.ventures/hs-fs/hubfs/Imported_Blog_Media/Screen-Shot-2019-06-03-at-11_42_09-AM.png?width=245&height=329&name=Screen-Shot-2019-06-03-at-11_42_09-AM.png) ![](https://blog.webrtc.ventures/hs-fs/hubfs/Imported_Blog_Media/Screen-Shot-2019-06-03-at-11_42_09-AM.png?width=245&height=329&name=Screen-Shot-2019-06-03-at-11_42_09-AM.png)

In this lecture, it was clear that all these small changes were directed to specific data manipulation instead of changes in the code to simulate the behavior of the reality creating new classes and their functionality.

In conclusion, neither of the paradigms is better or worse than the other. It comes down to how the requirements will take place and how the data will change during the implementation. Luckily, Ruby and Rails have everything we need to create a web app with object-oriented or functional programming in mind.

[CPaaS](https://blog.webrtc.ventures/tag/cpaas), [Managed Services](https://blog.webrtc.ventures/tag/managed-services), [Events](https://blog.webrtc.ventures/tag/events), [Video Conferencing](https://blog.webrtc.ventures/tag/video-conferencing), [Real Time Weekly](https://blog.webrtc.ventures/tag/real-time-weekly), [WebRTC Architecture](https://blog.webrtc.ventures/tag/webrtc-architecture), [Broadcasting](https://blog.webrtc.ventures/tag/broadcasting), [Medical](https://blog.webrtc.ventures/tag/medical), [WebRTC Live](https://blog.webrtc.ventures/tag/webrtc-live), [Showcase](https://blog.webrtc.ventures/tag/showcase), [Thoughts](https://blog.webrtc.ventures/tag/thoughts), [Vonage](https://blog.webrtc.ventures/tag/vonage), [Daily](https://blog.webrtc.ventures/tag/daily), [Jobs](https://blog.webrtc.ventures/tag/jobs), [Contact Centers](https://blog.webrtc.ventures/tag/contact-centers), [Telehealth](https://blog.webrtc.ventures/tag/telehealth), [Education](https://blog.webrtc.ventures/tag/education), [Technical](https://blog.webrtc.ventures/tag/technical), [General](https://blog.webrtc.ventures/tag/general), [Story of success](https://blog.webrtc.ventures/tag/story-of-success), [The WebRTC.ventures Blog](https://blog.webrtc.ventures/tag/the-webrtc-ventures-blog), [Testing](https://blog.webrtc.ventures/tag/testing), [Gaming](https://blog.webrtc.ventures/tag/gaming), [DevOps](https://blog.webrtc.ventures/tag/devops), [Symbl.ai](https://blog.webrtc.ventures/tag/symbl-ai)

## Related posts

[![](https://blog.webrtc.ventures/hs-fs/hubfs/Imported_Blog_Media/Hiring-a-QA-Functional-Tester.png?height=200&name=Hiring-a-QA-Functional-Tester.png)](https://blog.webrtc.ventures/2022/08/hiring-qa-functional-tester)

## [WebRTC.Ventures is Hiring a QA Functional Tester](https://blog.webrtc.ventures/2022/08/hiring-qa-functional-tester)

![Picture of Jen Oppenheimer](https://blog.webrtc.ventures/hs-fs/hubfs/Our-Team-Jen.jpg?width=50&name=Our-Team-Jen.jpg) [Jen Oppenheimer](https://blog.webrtc.ventures/author/jen-oppenheimer) 

 Aug 8, 2022 12:00:00 AM

WebRTC.ventures, a leading integrator of WebRTC into live video applications, is continuing to grow...

[Read more](https://blog.webrtc.ventures/2022/08/hiring-qa-functional-tester)

[![](https://blog.webrtc.ventures/hs-fs/hubfs/Imported_Blog_Media/Component-Driven-WebRTC-Architecture.png?height=200&name=Component-Driven-WebRTC-Architecture.png)](https://blog.webrtc.ventures/2021/11/component-driven-webrtc-architecture)

## [Component-Driven WebRTC Architecture](https://blog.webrtc.ventures/2021/11/component-driven-webrtc-architecture)

![Picture of Jen Oppenheimer](https://blog.webrtc.ventures/hs-fs/hubfs/Our-Team-Jen.jpg?width=50&name=Our-Team-Jen.jpg) [Jen Oppenheimer](https://blog.webrtc.ventures/author/jen-oppenheimer) 

 Nov 11, 2021 12:00:00 AM

Building applications with WebRTC has seen continuous improvement over the years, as our team can...

[Read more](https://blog.webrtc.ventures/2021/11/component-driven-webrtc-architecture)

[![](https://blog.webrtc.ventures/hs-fs/hubfs/Imported_Blog_Media/Default-B-Apr-03-2024-06-35-38-5636-PM.jpg?height=200&name=Default-B-Apr-03-2024-06-35-38-5636-PM.jpg)](https://blog.webrtc.ventures/2022/10/load-testing-for-webrtc-using-loadero)

## [Load Testing for WebRTC using Loadero](https://blog.webrtc.ventures/2022/10/load-testing-for-webrtc-using-loadero)

[Andrée Gutiérrez](https://blog.webrtc.ventures/author/andrée-gutiérrez) 

 Oct 21, 2022 12:00:00 AM

Load testing is a non-functional type of testing used to evaluate the performance of a software...

[Read more](https://blog.webrtc.ventures/2022/10/load-testing-for-webrtc-using-loadero)

### WebRTC.Ventures Services

...

- Assess
- Build
- Integrate
- Test
- Deploy & Manage

### Contact Us

...

**Video should be an opportunity, not a headache.**   
 We’re here to build, integrate, assess and optimize, test, and even deploy and manage your live video application. 

[Contact us](https://blog.webrtc.ventures/2019/06/thoughts-on-sprinkles-of-functional-programming#contact)

### WebRTC Live

...

 View [past episodes](https://blog.webrtc.ventures/webrtc-live/) of our webinar interview series about the latest webRTC use cases and technical updates. Join our mailing list to learn about upcoming episodes! 

![WebRTC Live](https://blog.webrtc.ventures/hs-fs/hubfs/Template%20Images/widged-bannet.webp?height=90&name=widged-bannet.webp)

![logo-main-light](https://blog.webrtc.ventures/hubfs/logo-main-light.svg "logo-main-light")

We’re one of the few agencies in the world dedicated to WebRTC development. This dedication and experience is why so many people trust us to help bring live video application dreams to life.

 

### Let's get started!

###### **[Contact us today](https://webrtc.ventures/contact/)**

**[info@webrtc.ventures](mailto:info@webrtc.ventures)**

<https://www.linkedin.com/company/webrtc-ventures> <https://www.youtube.com/@WebrtcVentures>

### Join our mailing list

We don't e-mail often (a few times a month max), and it will be worth it when we do! Of course, we respect your privacy and will not share your contact information.

© 2023 WebRTC.ventures, an [AgilityFeat](https://agilityfeat.com/) company / [Privacy Policy](https://webrtc.ventures/privacy-policy//)

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Alberto Gonzalez",
    "url" : "https://blog.webrtc.ventures/author/alberto-gonzalez"
  },
  "dateModified" : "2024-04-03T19:02:12.158Z",
  "datePublished" : "2019-06-04T04:00:00.000Z",
  "headline" : "Thoughts on \"Sprinkles of Functional Programming\" – WebRTC.ventures",
  "image" : [ "https://blog.webrtc.ventures/hubfs/Imported_Blog_Media/Blog-Post.png" ],
  "mainEntityOfPage" : {
    "@id" : "https://blog.webrtc.ventures/2019/06/thoughts-on-sprinkles-of-functional-programming",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://blog.webrtc.ventures/hubfs/logo-main-light.svg"
    }
  }
}
```