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.
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.
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).
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.
Quote from "How To Become a Hacker" by Eric S. Raymond: http://www.catb.org/esr/faqs/hacker-howto.html
Doesn't mean you have to like it, but they are different.
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?
> 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...
>> 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.
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.
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.