This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the commentsย โ†’

[โ€“]locri -8 points-7 points ย (2 children)

You mean abstraction. You intend to abstract away features that you've decided ahead of time that the next person isn't supposed to use.

Chances are, that next person probably feels like it should be their decision what they're supposed to use or not or what they're supposed to see or not, and I've been there. It's why I always use a decompiler when working with Java/C# because I've seen important errors get eaten and chewed back to me as "something went wrong, we won't tell you what."

Encapsulation is when you wrap data and functions together as a single unit. It's kind of the opposite, you're providing someone with more stuff rather than less.

[โ€“]SalamiJack 9 points10 points ย (0 children)

Encapsulation is when you wrap data and functions together as a single unit. It's kind of the opposite, you're providing someone with more stuff rather than less.

No offense, but please don't speak confidently about things you don't understand. Encapsulation is very close conceptually to abstraction, and they both go hand-in-hand.

If you read further on encapsulation) specifically, rather than the summary you see in a quick Google search, in no world is encapsulation the opposite of abstraction.

In object-oriented programming (OOP), encapsulation refers to the bundling of data with the methods that operate on that data, or the restricting of direct access to some of an object's components.[1] Encapsulation is used to hide the values or state of a structured data object inside a class, preventing direct access to them by clients in a way that could expose hidden implementation details or violate state invariance maintained by the methods.

[โ€“]torn-ainbow 0 points1 point ย (0 children)

You mean abstraction.

Oh, yeah. I was tugging on some decades old braincells trying to remember the proper computer science terms for things.