Most active commenters
  • em-bee(9)
  • mpweiher(8)
  • pjmlp(7)
  • itslennysfault(3)
  • bunderbunder(3)

←back to thread

107 points wmlive | 58 comments | | HN request time: 1.746s | source | bottom
1. itslennysfault ◴[] No.42129253[source]
So, this is why the abomination that is Obj-C is/was used for iPhone/Mac apps. I can't overstate how much I hate Obj-C. I'm so sooo happy Swift has pretty much entirely taken over.

Side note... I feel similarly about the Java to Kotlin transition. Sooo much better. Although, I don't hate Java NEARLY as much as Obj-C.

replies(5): >>42129327 #>>42129817 #>>42130011 #>>42130250 #>>42130804 #
2. ramesh31 ◴[] No.42129327[source]
To each their own. I'm convinced it's just a visceral reaction to the square bracket syntax. Obj-C remains my favorite language of all time (although I haven't written it in years). Having a high level language that allows you to seamlessly drop into C felt like magic.
replies(5): >>42129520 #>>42129543 #>>42129839 #>>42130389 #>>42130417 #
3. ◴[] No.42129520[source]
4. nullpoint420 ◴[] No.42129543[source]
I'm using Obj-C for the first time in years for a side project. I'm working on making a Wayland backend for cocotron on Linux.

It is magical the way I can just use the C libraries with all the dynamic goodness Obj-C.

replies(1): >>42130331 #
5. wslh ◴[] No.42129817[source]
I did a few things in Obj-C and I only regretted the memory handling stuff. I really liked the performance, reflexibility capabilities (reverse engineering classes is almost trivial) and smalltalk like style. I will not choose it for any project but it gives me the taste that there were more options around C/C++
replies(1): >>42130948 #
6. itslennysfault ◴[] No.42129839[source]
Interesting, I guess that part was missed on me since I only really ever used it for iPhone apps and never really had a need to use C directly.

Also, you're 100% right. The square brackets are what immediately repulsed me and continued to befuddle me even after years of experience with it. Also, everything just feels "backwards" to me if that makes any sense. Coming from Java/C#/JavaScript everything just seemed unintuitive to me at all times. Also, I think this was heavily compounded by using xCode which (at the time) was incredibly laggy. So, I'd mess up the Obj-C syntax and the IDE wouldn't tell me for what felt like forever. Often I'd make a change and hit "play" before the syntax highlighting caught up and that always felt infuriating.

I last used xCode about 4 years ago and it was still an issue then (even with swift).

replies(3): >>42130086 #>>42130409 #>>42131134 #
7. mentos ◴[] No.42130011[source]
Did you start with Swift or Objective-C?

I started with Objective-C and loved it but I imagine that wouldn’t have been the case if I started with Swift.

replies(3): >>42130326 #>>42146460 #>>42150177 #
8. ramesh31 ◴[] No.42130086{3}[source]
>"Also, everything just feels "backwards" to me if that makes any sense."

Because it is. Obj-C comes from the Smalltalk lineage by way of Alan Kay, using message passing [0] versus method invocation. It's a subtle difference with huge implications to how you design systems. Method invocation won out mostly because of Java and C++, but there was a time it wasn't clear which was the better OO paradigm.

[0] https://en.m.wikipedia.org/wiki/Message_passing

replies(3): >>42130432 #>>42130874 #>>42132104 #
9. incanus77 ◴[] No.42130250[source]
I'm back in Objective-C now for a large mixed codebase for a client and enjoying it. It was my first compiled language starting in 2002 so I've got about equal time with only it as I do with Swift alongside. And I'm spending more time these days in other projects (microcontrollers, mostly) using C so it's a breath of fresh air. I'm finding it generally faster than Swift in Xcode, which is a bonus.
replies(1): >>42131095 #
10. bunderbunder ◴[] No.42130326[source]
Same. I realize that Objective-C is dated by contemporary standards. But when I first learned it 20-ish years ago it felt like a superpower. I bet it was even more impressive when it first appeared another 20 years further back.

I think that one of the tragedies of older programming languages is that they survive long enough for people to forget the technical - and technological - constraints that influenced their design. Swift is great, but there are reasons why there weren't any Swift-like languages being developed in or around 1984.

Similar feelings about Java. It is definitely not my favorite programming language. (I suppose Kotlin isn't either, but it's in the top n.) But it's hard for me to actually hate it. Java walked so that Kotlin could run.

11. Longhanks ◴[] No.42130331{3}[source]
There's even more magic: You can even use/include/write/mix and match ObjC with C++, within the same source file - C++ classes calling ObjC methods, ObjC methods instantiating C++ classes, it's all there. No other language comes close to this kind of interop with C++ and it is one feature that Swift will never be able to match (albeit intentionally).
replies(1): >>42130612 #
12. jwells89 ◴[] No.42130389[source]
For personal use, the only issue I take with Obj-C is how it's considerably less "batteries included" relative to Swift.

For collaborative projects on the other hand, it can become a handful to maintain if everybody contributing isn't staying on top of hygiene with null checks, type checks, etc. Swift helps to keep all of that under control.

13. robenkleene ◴[] No.42130409{3}[source]
I've been an Mac and iOS engineer for over a decade, and none of this makes any sense to me. Everything you listed (besides the brackets) is worse in Swift than in Objective-C (Swift has real problems with live error checking in Xcode in particular, due to the additional compilation complexity since it's a significantly more complicated language).

I've observed some folks have a visceral reaction to having to use Xcode, I don't really understand it myself. I can understand being annoyed at having to use a specific IDE to write iOS and Mac apps, e.g., it's harder to bring your own text editor like you usually can, it's going to make your life a lot harder if you try to to avoid using Xcode. But comparing Xcode to any IDEs like the JetBrains IDEs I've used (mainly the discontinued AppCode), Android Studio (also JetBrains under the hood), or other similarly complex development environments like Unreal or Unity, I don't see any of these as a clear winner. Personally I'd prefer using Xcode to any of those. I suspect this comes down to just whether you like native Mac apps or not, Xcode is a native Mac app and if you like that aesthetic than you'll like Xcode. I suspect most of the dislike for Xcode is really just folks who dislike the Mac platform (e.g., the UI toolkit) overall.

replies(1): >>42130827 #
14. cxr ◴[] No.42130417[source]
Someone really ought to do an alternative "skin" for Objective-C. That is, define some reversible transformation that can be applied to any Objective-C program that only changes the surface-level details but otherwise results in mapping the exact same program into the later stages of the compiler (and the section of programmers' mental pipeline that comes after the part where their eyeballs and sense of taste are concerned). It's important that the reversible part be adhered to.

It's really kind of a bummer that we don't have well-known examples of "skinnable" programming languages already. The closest we get are the ones that let you choose your set of keywords for different locales in case you don't want to work with an English-based PL and those block based languages that let you manipulate them as blocks or edit the textual form. I firmly believe that PL skinning would really benefit so many otherwise worthwhile languages that get short-shrift because of negative reactions to the surface-level details. I'm referring in particular languages like those in the Pascal family. (You could also conceive of e.g. a skin for Golang that doesn't have leading caps be the determiner for whether a function is public or not. There are lots of applications for this, and the variations are a non-issue when you have an ecosystem with strong norms about applying a code formatter (like gofmt), which can dictate the format of the canonical on-disk representation.)

replies(3): >>42130711 #>>42130941 #>>42145509 #
15. bunderbunder ◴[] No.42130432{4}[source]
Message passing belongs up there with lisp, forth and pure functional programming as paradigms that are worth learning for "the profound enlightenment experience you will have when you finally get it." But I often see that my peers in the profession lack the kind of growth mentality that enables a person to see past the alienness of less algol-y languages.

Quote from "How To Become a Hacker" by Eric S. Raymond: http://www.catb.org/esr/faqs/hacker-howto.html

replies(1): >>42132261 #
16. tambourine_man ◴[] No.42130612{4}[source]
https://www.swift.org/documentation/cxx-interop/
replies(1): >>42130785 #
17. Aeglaecia ◴[] No.42130711{3}[source]
surely after 20 years this already exists , someone posted a header the other day that makes c syntax python like , macros are enough to accomplish what youre describing? i dont perceive it as efficient to force codebase contributors to relearn their ingrained language syntax , possibly more efficient for those having newly learned a language tho ...
replies(1): >>42133127 #
18. Longhanks ◴[] No.42130785{5}[source]
Yes, there is interop at the linking level. I was however explicitly stating that you can mix and match both ObjC and C++ within the same source files and as long as you don't violate the language rules of one with what's allowed in the other (e.g. giving your ObjC variable the name template), then absolutely any features, even language-wise, are supported. You can have C++ RAII destructors call ObjC methods. You can have C++ classes with an NSArray member. You can have a std::vector as a property of your ObjC class. You can mix and match libdispatch, std::call_once, ObjC blocks and C++ lambdas.

No other language comes close to this incredible source-level interop. Here be dragons, but there's also lots of opportunity (and fun, from a programming languace theory perspective).

19. pjmlp ◴[] No.42130804[source]
Metal is implemented in a mix of Objective-C (CPU) and C++ (Metal Shaders), Swift only has bindings.

Maybe one it they will rewrite the Objective-C, who knows.

Kotlin transition is a Google thing, outside Android barely anyone notices that it exists.

replies(1): >>42131103 #
20. pjmlp ◴[] No.42130827{4}[source]
I think it comes from the folks that aren't really into Apple culture, rather they buy Apple because of UNIX, or want to target iDevices without culture background on the ecosystem.
replies(1): >>42132219 #
21. pjmlp ◴[] No.42130874{4}[source]
Java is heavily based in Smalltalk and Objective-C, even if it has a C++ like syntax for mainstream adoption.

https://cs.gmu.edu/~sean/stuff/java-objc.html

Even Java EE was actually a rebooted Objective-C based project done internally at Sun during the OpenSTEP days, aka Distributed Objects Everywhere.

22. mpweiher ◴[] No.42130941{3}[source]
The Four Stages of Objective-Smalltalk

https://blog.metaobject.com/2019/12/the-4-stages-of-objectiv...

Its first two stages are just that, but it has moved beyond, for good reasons.

23. pjmlp ◴[] No.42130948[source]
There has been plenty of options back in the day, it was guaranteed that C and C++ would take over everything as they did during the late 1990's.

Even the Object Pascal to C++ transition at Apple was mostly caused by increased UNIX adoption, and Apple programmers wanting to offer similar experiences, thus MPW was born.

Same on other platforms, until C and C++ eventually won everywhere, at least until several new kids decided to challenge them in various fronts.

One that you seldom see nowadays, outside games, is pure GUI frameworks using C or C++.

24. neverartful ◴[] No.42131095[source]
I too am back in Objective-C and being away from it for a long while and I'm also enjoying it. For the most part, I really like Objective-C. I think it's a very pragmatic language. My current project is macOS, but the vast majority of my prior work with Xcode and ObjC was with iOS development.
25. ahoka ◴[] No.42131103[source]
“Kotlin transition is a Google thing, outside Android barely anyone notices that it exists.”

That’s not true.

replies(1): >>42134068 #
26. neverartful ◴[] No.42131134{3}[source]
The square brackets can be a huge impediment when first working on Obj-C (it was to me). I found that after some period of time to acclimate they eventually felt 'normal'.
27. em-bee ◴[] No.42132104{4}[source]
i have learned smalltalk, common lisp, java, python, ruby, perl, php, C, javacript and a few other languages, and i still do not understand the difference between message passing and function invocation. they look the same to me. according to wikipedia the difference is

"In contrast to the traditional technique of calling a program by name, message passing uses an object model to distinguish the general function from the specific implementations. The invoking program sends a message and relies on the object to select and execute the appropriate code."

Method invocation won out mostly because of Java and C++

but according to the wikipedia article java uses message passing.

supposedly the distinction is that i can have a generic method that gets called if a named method can not be found. in smalltalk that's doesNotUnderstand: in ruby it's method_missing. javascript used to have __noSuchMethod__, in php i can overload __call, in pike i do the same with defining a method called `(), and many more.

so are they all using message passing? and then if java is supposed to use message passing and javascript removed __noSuchMethod__ it seems that alone can't be the distinction.

if there is a distinction at all then it look more like an implementation detail that does not actually affect what kind of code you can write, and more importantly, based on that it is not at all clear that method invocation won out.

replies(3): >>42132608 #>>42133455 #>>42137340 #
28. nullpoint420 ◴[] No.42132219{5}[source]
Bingo. I'm tired of people claiming that macOS (XNU more specifically) is just BSD under the hood. It's called X is not Unix for a reason!

I feel like so much awesome engineering in XNU around security and portability, as well as innovations like IOKit are swept under the rug because "it's just FreeBSD."

I still think it's a shame that more people don't take advantage of the Mach side of XNU more. Launchd and Mach ports are a powerful combination IMO.

29. em-bee ◴[] No.42132261{5}[source]
see my comment above: https://news.ycombinator.com/item?id=42132104 i can't tell the difference and therefore i don't see what profound enlightenment experience i am supposed to have.
replies(2): >>42151321 #>>42229232 #
30. astrange ◴[] No.42132608{5}[source]
The difference is NSInvocation. A function pointer doesn't capture the arguments to the function, but a message does.

Also, you can change the destination of a message send at runtime, but you can't change the destination of a function call unless you're dtrace and can do code patching.

replies(1): >>42132712 #
31. em-bee ◴[] No.42132712{6}[source]
ok, so that means message passing needs a runtime, and it can be assumed that pretty much every language that has a runtime uses message passing. more evidence that it is message passing that won out.

and the profound enlightenment ( https://news.ycombinator.com/item?id=42130432 ) is not specific to message passing but about a dynamic language runtime. being able to intercept messages/function calls is just one of the benefits of that.

replies(1): >>42133600 #
32. cxr ◴[] No.42133127{4}[source]
> i dont perceive it as efficient to force codebase contributors to relearn their ingrained language syntax

That's why it's important that the transformation be reversible and what the gofmt-like code formatters are for.

33. kazinator ◴[] No.42133455{5}[source]
If the "message passing" implementation blows the stack when something sends a message to itself, then you know that they are calling function calls "message passing".

Bona fide message passing is asynchronous. A message is sent and the send operation immediately returns, without blocking for a reply.

Nothing else should be called "message passing".

replies(2): >>42135421 #>>42170548 #
34. astrange ◴[] No.42133600{7}[source]
Not sure if objc_msgSend is a runtime, but it does require malloc, so there are limits to how low level it can be.
replies(1): >>42170568 #
35. pjmlp ◴[] No.42134068{3}[source]
It certainly is, one just needs to check any programming language market share analysis that omits Android deployments.

Kotlin hardly does more than 10% of JVM workloads, and it isn't as if any JVM vendor is replacing Java with Kotlin on their JVM implementation.

Besides Google with ART, which is anyway not a JVM proper, not fully TCK compliant to start with.

replies(1): >>42134553 #
36. panick21_ ◴[] No.42134553{4}[source]
At least at my company we are increasingly using more and more Kotlin. And that happens in many places. This is Server JVM, not Android. And I know other places too.
replies(1): >>42136076 #
37. em-bee ◴[] No.42135421{6}[source]
i agree with that definition but then smalltalk nor any other language are using message passing for regular method calls because they are not asynchronous unless they use explicitly asynchronous methods.
38. pjmlp ◴[] No.42136076{5}[source]
Congratulations, you are part of those 10%.
replies(1): >>42136405 #
39. panick21_ ◴[] No.42136405{6}[source]
10% is a large number for a new language on a VM.
replies(1): >>42145530 #
40. bunderbunder ◴[] No.42137340{5}[source]
This is another example of where you've got to read Wikipedia with a skeptical eye. That one in-passing mention of Java is incorrect. I don't know why it's in there, WikiBlame indicates that it's been there since 2004, which was the early days of Wikipedia when it was particularly unreliable.

So, the gist of the difference is this: object-oriented programming is, at its core, about late binding. Specifically, delaying decisions about what code will run when until run-time. But there's still some wiggle room to decide how late certain decisions are made. Most mainstream object-oriented languages like Java and C# more-or-less wait until the start of run-time to decide, but at that point the mapping from argument type to which code is run is pretty much settled. (This isn't necessarily 100% true, but it's the general rule.)

In a system that uses message passing, it's pushed even later, to method invocation time. Basically, each object (actor, whatever) gets to decide what code will be executed to handle a message every time it receives a new message, even for messages of the same type. In practice, most the time it's always the same code. But the point is that this level of dynamicism is a first-class language feature and not just a thing you can accomplish with hacks.

replies(1): >>42145739 #
41. lukeh ◴[] No.42145509{3}[source]
Apple did implement this around the Mac OS X transition (I guess, probably Steve Naroff did it?) but it was not pursued, in favor Java bindings (which funnily enough are back in fashion with swift-java).
42. pjmlp ◴[] No.42145530{7}[source]
It certainly is, but it isn't Rewrite In Kotlin, that is so common to hear the community talk about, specially when their creators are quite open that it is a way to sell InteliJ licenses.

I can provide you the public statement on that, if you feel like not searching yourself.

43. em-bee ◴[] No.42145739{6}[source]
i understand your explanation, but i still don't see how i am supposed to tell the difference as a programmer. to be a first class language feature it has to be something the programmer can see and use consciously. the only feature there is the ability to have catchall methods, but while the existence of such a feature is an indication that very late binding happens, the absence of it does not indicate otherwise. so it goes back to pretty much all dynamic languages with a runtime probably use message passing because they either do have such a feature or could have it. but i don't see that claim supported anywhere. everyone just seems to talk about how smalltalk is somehow different, but i can't see how it is different from javascript, php, pike or other dynamic languages.

and i believe what you say about java and wikipedia. it just shows again that the distinction is not obvious.

i found this discussion on stackexchange: https://softwareengineering.stackexchange.com/questions/3352...

but reading that doesn't help me to tell the distinction between java and smalltalk either. the point appears to be that all OO is message passing, and the only distinction as far as i can tell is that java doesn't have extreme late-binding of all things, but that is something i can't know just by looking at the language. it's a hidden implementation detail. not being able to tell how the message is processed is another feature that message passing is supposed to have, btw.

the stackexchange answer however also shows why i am not seeing any revelation when using smalltalk. if all OO is supposed to be message passing then it's no wonder, it all looks the same to me.

note that i don't want to argue either way. i don't know enough about this to make any kind of argument. and i am trying to figure out the right questions to ask so i can learn and understand more. your comment did help me move forward at least. thanks.

44. throwaway655368 ◴[] No.42146460[source]
I started the iOS development with Objective-C and hated the language. gp's comment is pretty much my feeling as well. I wonder if I'd enjoy Swift so much if it wasn't in contrast to how utterly horrible Objective-C was. These days I still need to revisit legacy Obj-C codebases occasionally or make Obj-C wrappers to interface with C++ code and every time it feels like diving into a cesspit.
45. itslennysfault ◴[] No.42150177[source]
I was first introduced to Objective-C in 2010 when I worked on my first iPhone app. I've come back to it a half dozen times over the past 15 years since then and always hate it. I only discovered swift a few years ago (when I had to do some iPhone stuff) and was so happy to not need to use Obj-C
46. mpweiher ◴[] No.42151321{6}[source]
If you can't tell the difference, you didn't actually learn it.

Doesn't mean you have to like it, but they are different.

replies(1): >>42156273 #
47. em-bee ◴[] No.42156273{7}[source]
you may want to read the whole discussion following the linked comment to understand what i learned. if you have any additional insights i'd appreciate your input.
replies(1): >>42161058 #
48. mpweiher ◴[] No.42161058{8}[source]
What makes you think I didn't?
replies(1): >>42163197 #
49. em-bee ◴[] No.42163197{9}[source]
well, if you did, then can you please tell me what i am missing? i have written a decent amount if smalltalk code, and even held workshops teaching smalltalk to others. and i have written lots of code in many other languages.

i did see differences. the most awesome was when i wrote some code to respond to an http request, the code failed, the http request stalled, i fixed the code live, and then the http request resumed.

but i can do the same in pike if i tried, and i expect in lisp and other languages too.

and if that is the case then it supports my understanding that most OO languages use message passing. where then is the great revelation that comes from smalltalk?

replies(1): >>42170518 #
50. mpweiher ◴[] No.42170518{10}[source]
>> i can't tell the difference

> i did see differences.

Spot the difference. ;-)

> but i can do the same in pike if i tried, and i expect in lisp and other languages too.

Absolutely you can! You can even do it in C: write yourself a message-passing library in C. You might want to call it Objective-C. Or do a VM for Smalltalk.

> where then is the great revelation that comes from smalltalk?

The claim was not that the great revelation came from Smalltalk, but that it came from message passing:

>>> Message passing belongs up there with lisp, forth and pure functional programming as paradigms that are worth learning for "the profound enlightenment experience you will have when you finally get it."

Smalltalk isn't even mentioned in that little section about the enlightenment.

And in fact, Smalltalk's form of message-passing is pretty limited, it only just extends beyond method invocation and it certainly can be (and is) frequently used just like method invocation. If you want to do more sophisticated things, you mostly have to go via the DNU handler, which is a bit hacky.

And in fact, Alan Kay's famous OOPSLA '97 quip "I made up the term object oriented. And I can tell you I did not have C++ in mind." was followed immediately with the slightly less famous "So, the important thing here is: I have many of the same feelings about Smalltalk". https://www.youtube.com/watch?t=634&v=oKg1hTOQXoY&feature=yo...

And even message-passing is much broader: for example, with Higher Order Messaging, you can control how messages are delivered: to collections, on different threads, delayed, distributed (combine distributed + delayed and you get TeaTime/Croquet), conditionally only if the receiver understands the message, etc.

https://en.wikipedia.org/wiki/Higher_order_message

https://www.youtube.com/watch?v=GBtqQwcJoN0

And even that just scratches the surface. When you look at something like the Enterprise Integration Patterns, that's distributed asynchronous messaging, which opens up a whole other universe. Also: Erlang.

https://www.enterpriseintegrationpatterns.com

https://stackoverflow.com/questions/3431509/is-erlang-object...

replies(1): >>42171329 #
51. mpweiher ◴[] No.42170548{6}[source]
Nah...IMHO message-passing is a generalization.

The point is that it encompasses all of these things: synchronous, asynchronous, local, distributed, late-bound, early bound, point-to-point, broadcast, multicast.

And ideally, you should be able to select which kind you want on a case-by-case basis. With ease.

Rather than having to choose a different programming language.

52. mpweiher ◴[] No.42170568{8}[source]
> objc_msgSend [...] does require malloc,

Are you sure about that?

    ]pwd
    objc4/runtime/Messengers.subproj
    ]rg malloc
    ]
The two variants I implemented way back when also did not require malloc.

And of course NeXT used objc_msgSend() in the kernel, to good effect, so that's pretty low-level.

53. em-bee ◴[] No.42171329{11}[source]
thank you. so really the problem is that nobody seems to be aware that most OO languages are actually using message passing. unfortunately that results in that quote becoming meaningless because it tells people to do something that they are already doing, and then they wonder why they don't learn anything. it's like telling people that they need to add H₂O or aqua to their diet.

>> i can't tell the difference

> i did see differences.

Spot the difference. ;-)

well the first refers to the difference between message passing and function calling. which i couldn't see because all languages i worked with are using message passing.

the second refers to the difference between smalltalk and other languages, which owes to the particular implementation of smalltalk, and not just message passing.

in summary, you are confirming what i thought i understood. it appears i need to do the reverse and actually explore languages that don't do message passing to see the difference.

replies(1): >>42177918 #
54. mpweiher ◴[] No.42177918{12}[source]
> so really the problem is that nobody seems to be aware that most OO languages are actually using message passing.

That turns out not to be the case. C++ is not. Java is not.

Of course, many would say that those two are not object-oriented, so that way around you can make it work.

> which i couldn't see because all languages i worked with are using message passing.

That still is not the case. So your explanation for the contradiction in your statements also makes no sense.

> in summary, you are confirming what i thought i understood.

No, I am most emphatically not doing that, and what I've written makes that very, very clear. There is little I can add to that, I could only repeat myself.

Have a nice day.

replies(2): >>42179158 #>>42179190 #
55. ◴[] No.42179158{13}[source]
56. em-bee ◴[] No.42179190{13}[source]
That turns out not to be the case. C++ is not. Java is not.

i meant all the languages besides those. if you make a list of all known OO languages, most of them will be dynamic languages with message passing. C++ and java and a few others will be the exception.

> which i couldn't see because all languages i worked with are using message passing.

That still is not the case

do you know which languages i have worked with? which of those do not use message passing?

what I've written makes that very, very clear

well it appears we are talking past each other, and therefore it doesn't.

replies(1): >>42181028 #
57. mpweiher ◴[] No.42181028{14}[source]
> well it appears we are talking past each other, and therefore it doesn't.

Well yes, you've basically ignored everything I've written and then blithely claimed the opposite.

58. igouy ◴[] No.42229232{6}[source]
fwiw

'what matters about an object is its protocol: the set of messages that it understands, and the way that it behaves in response to those messages. Nowadays, this is sometimes also referred to as the objectʼs interface. The key idea is that when we use an object, we focus on how it appears from the outside, and “abstract away from” its internal structure: more simply, that the internal structure of an object is hidden from all other objects. Thatʼs why I said “the set of messages that it understands,” and not “the set of methods that it implements.” In many languages they are the same, but I wanted to emphasise the external rather than the internal view.'

"Object-oriented programming: Some history, and challenges for the next fifty years" Andrew P. Black

https://doi.org/10.1016/j.ic.2013.08.002

So, a matter of emphasis?