4 ms·
I think that at this point this is a discussion about semantics, just as this other commenter pointed out: https://news.ycombinator.com/item?id=36758407 https:/
by gjulianm 3y ago
I think that at this point this is a discussion about semantics, just as this other commenter pointed out: https://news.ycombinator.com/item?id=36758407 https://news.ycombinator.com/item?id=36758407
Yes, you can do something in C that somewhat resembles encapsulation. You could also do it in Python with a decorator that inspects the caller. You can also do inheritance and virtual functions in C. You could do anything in a Turing complete language. But usually when talking about "X language has Y" refers to whether the language has Y as part of the specification. In this case it isn't encapsulation as part of the specification (that's why it comes with all those downsides/extras) but as an artifact of other aspects of the language, that's why I say it's not really equivalent.