`restricted` member variables
Jordan Wilson
wilsonjord at gmail.com
Thu Jun 23 06:55:30 UTC 2022
On Thursday, 23 June 2022 at 05:22:26 UTC, forkit wrote:
> On Thursday, 23 June 2022 at 05:09:17 UTC, forkit wrote:
>>
>
> gather around kids...
>
> This is how encapsulation is achieved.
>
> Each object is in charge of its own state.
>
> Each object keeps that state private.
>
> Other objects don’t have direct access to this state.
>
> Instead, they can only call a list of public functions — called
> methods.
>
> Now if your using the D programming langauge, this isn't the
> entire story. The rest of that story is in that big, black,
> scary book on the top shelf. In that book, you can make a cat
> bark, if you want. But we won't go there. It's too scary!
>
> "How to explain object-oriented programming concepts to a
> 6-year-old"
>
> https://www.freecodecamp.org/news/object-oriented-programming-concepts-21bb035f7260/
Well, you what they say, if first you don't succeed (with
copy/pasted appeals to authority), then try, try again (this
time, with extra condescension).
More information about the Digitalmars-d
mailing list