Back to Freecodecamp

Task 24

curriculum/challenges/english/blocks/learn-how-to-clarify-misunderstandings/67e7daa349ab984882c0f60e.md

latest2.3 KB
Original Source
<!-- (Audio) Sophie: Not quite. "Encapsulation" is about keeping some details hidden to make the code easier to work with. -->

--instructions--

Listen to the audio and answer the question below.

--questions--

--text--

What does Sophie say about encapsulation?

--answers--

It is about making code more difficult to manage by exposing all details.

--feedback--

Sophie emphasizes making code easier to work with, not harder.


It is about hiding details to make the code less understandable.

--feedback--

Sophie mentions making the code easier to work with, not harder to understand.


It is about hiding some details to make the code easier to understand or update.


It is about organizing code into separate files to improve readability.

--feedback--

This answer focuses on organizing code into files, but encapsulation is more about hiding internal details within a structure or class.

--video-solution--

3

--explanation--

Sophie starts by saying not quite, which shows that Mark's previous understanding was partially correct but needed clarification. She then provides the correct definition of encapsulation.

Keeping some details hidden refers to the practice of hiding the internal workings of a class or function, not exposing the internal details, like data or implementation logic, to the outside world.

The purpose of encapsulation is to make it easier for developers to use and manage the code.

--scene--

json
{
  "setup": {
    "background": "company2-center.png",
    "characters": [
      {
        "character": "Sophie",
        "position": {
          "x": 50,
          "y": 0,
          "z": 1.4
        },
        "opacity": 0
      }
    ],
    "audio": {
      "filename": "B1_16-1.mp3",
      "startTime": 1,
      "startTimestamp": 37.58,
      "finishTimestamp": 43.36
    }
  },
  "commands": [
    {
      "character": "Sophie",
      "opacity": 1,
      "startTime": 0
    },
    {
      "character": "Sophie",
      "startTime": 1,
      "finishTime": 6.78,
      "dialogue": {
        "text": "Not quite. Encapsulation is about keeping some details hidden to make the code easier to work with.",
        "align": "center"
      }
    },
    {
      "character": "Sophie",
      "opacity": 0,
      "startTime": 7.28
    }
  ]
}