1. Home
  2. Explore
  3. Computer Science
  4. Functional Programming Skills

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Functional Programming Skills

  • 40Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Functional Perspective
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

How can functional programming be understood without relying on a single definition?

Tap to flipClick to flipspace

As a set of skills that functional programmers use more often than programmers using other paradigms.

Or swipe the card

40 cards

  1. How can functional programming be understood without relying on a single definition?

    As a set of skills that functional programmers use more often than programmers using other paradigms.

  2. Are functional programming skills incompatible with object-oriented programming?

    No. Functional programming skills can be mixed with object-oriented skills such as encapsulation and object-oriented modeling.

  3. What are the five major functional programming skills described?

    Discriminating actions, calculations, and data; working with immutable values; using and creating higher-order calculations and actions; data modeling; and functional architecture.

  4. Why is identifying programming skills often more useful than debating definitions?

    It focuses attention on practices that programmers actually use instead of on whether a particular technique formally qualifies as functional programming.

  5. What is the first essential skill in functional programming?

    Being able to distinguish among actions, calculations, and data in code.

  6. What is a calculation?

    A computation that maps inputs to outputs and produces the same result when given the same arguments, regardless of when it runs.

  7. What is an action?

    An operation whose result or effect can depend on when it is run.

  8. How do the operators + and ++ illustrate the difference between calculations and actions?

    The arithmetic operator + is a calculation, while ++ is an action because it changes a value.

  9. Why are calculations and data generally easier to work with than actions?

    They are easier to test and reuse because their behavior does not depend on when they are run.

  10. Why should functional programmers try to minimize code inside actions?

    Actions are harder to manage, so moving logic into calculations reduces concerns about when, how, and how many times that logic runs.

  11. What is the second major functional programming skill?

    Working effectively with immutable values.

  12. Why must programmers deliberately rebuild the discipline of immutability in software?

    Computer memory is mutable, so software does not automatically preserve records the way physical archival systems can.

  13. Where can the discipline of immutability be implemented?

    In the programming team's practices, in the programming language, or in the database.

  14. How does working with immutable data differ from working with mutable data?

    Immutable data cannot be changed in place; updates are handled by creating copies instead of writing over existing values.

  15. Why is nested data especially challenging when using immutable values?

    Changing a deeply nested value requires determining which parts of the surrounding data structure must be copied.

  16. What must a functional programmer determine when updating one item in an immutable nested structure?

    Which portions of the structure need to be copied so the update can be represented without modifying the original.

  17. What is the third major functional programming skill?

    Using and creating higher-order calculations and actions.

  18. What makes a calculation or action higher-order?

    It can be treated like any other value: passed as an argument, returned from a function, or stored in a variable.

  19. What does passing behavior to another function enable?

    It enables general mechanisms that can modify or coordinate that behavior, such as making an action idempotent or retrying it automatically.

  20. How can higher-order programming reduce boilerplate?

    A behavior such as retrying a failed action can be defined once and applied consistently instead of being rewritten for each action.

  21. What are map, filter, and reduce examples of?

    Higher-order functions that take functions as inputs and help build data-transformation pipelines.

  22. How can higher-order actions support failure handling?

    They can represent sequences of actions together with reusable rules for retries and responses to failure.

  23. What is an example of creating a higher-order calculation?

    Writing a function that accepts an unknown function and returns a new function that calculates its derivative.

  24. What is the fourth major functional programming skill?

    Data modeling: structuring measurements and facts about the world so software can use them effectively.

  25. What is public-facing data modeling?

    Designing data that leaves a library or server as part of an API.

  26. What is an important design constraint for public-facing data?

    It should be human-readable and sufficiently understandable for the developer or program consuming the API.

  27. What is internal data modeling?

    Structuring data inside a system to support the efficient execution of a task, such as searching a space.

  28. How do public-facing and internal data modeling differ?

    Public-facing modeling prioritizes external understandability, while internal modeling prioritizes effective and efficient computation.

  29. Why is data modeling considered a more advanced functional programming skill?

    It builds on the earlier ability to identify data and involves designing structures that support broader software processes.

  30. What is the fifth major functional programming skill?

    Functional architecture: applying architectural and design principles associated with functional programming to build scalable systems.

  31. What problem does software architecture address as a system grows?

    It keeps the system manageable and prevents increasing scale from causing the design to become disorganized or fragile.

  32. What is the basic cycle in reactive data architecture?

    Events are generated, consumed to modify centralized state, and used to produce a view of the world that is projected outward, such as onto a GUI.

  33. What drives behavior in reactive data architecture?

    Reactions to events and changes in data.

  34. What are the three main layers of the Onion Architecture?

    The interaction layer, the business rule layer, and the domain layer.

  35. What belongs in the interaction layer of the Onion Architecture?

    Actions that communicate with the outside world and receive external messages.

  36. What belongs in the business rule layer?

    Calculations that represent changing business requirements, such as payroll calculations and vacation policies.

  37. What belongs in the domain layer?

    The relatively timeless domain model representing fundamental concepts of the business.

  38. How does the Onion Architecture organize code by rate of change?

    Fast-changing interaction code is placed outside, business rules occupy the middle, and the least frequently changing domain model is placed inside.

  39. Why does the Onion Architecture place actions in the outer layer?

    Actions communicate with external systems, such as APIs, whose interfaces and versions tend to change rapidly.

  40. How are business rules different from domain concepts in the Onion Architecture?

    A business rule specifies a changeable policy, such as how much vacation employees receive, while a domain concept expresses a more timeless fact, such as employees receiving vacation.

Card 1 of 40
Card 1 of 40

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent