You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
- 1Good answer! One part I don't agree with: the distinction you're drawing about encapsulation isn't valid. Encapsulation always means "forbidding access beyond this interface" -- that's true for OOP and non-OOP settings alike. So this part isn't really something that's unique to OOP.D.W.– D.W.2017-03-20 16:05:00 +00:00Commented Mar 20, 2017 at 16:05
- @D.W. I've tried to clarify this, saying not that it's unique to OOP but that it's the difference between encapsulation and abstraction. Thanks for the feedback!Joey Eremondi– Joey Eremondi2017-03-20 17:47:19 +00:00Commented Mar 20, 2017 at 17:47
- 2OK. But I still have a different view about what is written here on that subject. You wrote that "here's some ways OOP is more nuanced than what you've said", but encapsulation isn't a way that OOP is more nuanced than what was written in the question. Encapsulation is what it is, in any paradigm. And where you wrote that " What you are describing is not OOP, it's abstraction", I thought the original question was trying to describe encapsulation (not just abstraction). I guess I'll just leave this comment as a different perspective. I do think the answer is very helpful!D.W.– D.W.2017-03-20 17:56:39 +00:00Commented Mar 20, 2017 at 17:56
- 1Inheritance is a common feature, but several important OO languages lack it.B. Szonye– B. Szonye2017-03-23 02:34:41 +00:00Commented Mar 23, 2017 at 2:34
- Good answer, but IMO you're overstating the car example. An engine for a given model has a well-defined interface (cam shaft, mounting bracket "receptacles", etc.). You can replace a plain old carburetor with a fuel-injected one, add a turbo-charger, etc. without affecting the transmission. (Although a diesel engine does require a modified fuel tank IIRC.) Conversely, you can replace a manual transmission with an automatic and AFAIK that doesn't affect the engine at all.David– David2017-03-23 13:03:14 +00:00Commented Mar 23, 2017 at 13:03
| Show 1 more comment
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. design-patterns), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you