We discuss the separation of data and functions in functional programming, and how this separation compares to object-oriented programming. We then discuss the benefits of separating functions and data.
- [Instructor] The second major concept…of functional programming is the separation…of data and functions.…For our purposes, data might be any values…that a program contains: people's names, addresses,…and social security numbers in a payroll program,…the models, years, and colors of cars on a used car website,…the positions, health levels, and weapons of characters…in a video game, anything.…Functions, on the other hand, might be any operation…that we can apply to our data to convert it…into useful information.…For example, if we want to find the average salary…of programmers at our company, find all the cars…on our website that were made after a certain year,…or find if two characters are colliding in a video game.…
If you're coming from an object-oriented background,…it may seem strange to you that functional programming…places an emphasis on keeping data and functions separate…since one of the central concepts…of object-oriented programming is that we put data…and the functions related to that data together in objects.…
- What is functional programming?
- Keeping functions and data separate
- First-class functions
- Working with arrays functionally
- Filtering and reducing
- Partial-application and recursion
Skill Level Intermediate
Swift 4: Protocol-Oriented Programmingwith Károly Nyisztor1h 44m Intermediate
Swift: Delegations and Data Sourceswith Steven Lipton1h 6m Intermediate
Swift: Writing Reusable Frameworkswith David Okun1h 49m Intermediate
1. What Is Functional Programming?
2. First-Class Functions
3. Array Functions
4. Advanced Functional Concepts
Next steps1m 1s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.