←back to thread

107 points wmlive | 10 comments | | HN request time: 2.062s | source | bottom
Show context
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 #
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 #
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 #
ramesh31 ◴[] No.42130086[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 #
bunderbunder ◴[] No.42130432[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 #
em-bee ◴[] No.42132261[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 #
1. mpweiher ◴[] No.42151321[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 #
2. em-bee ◴[] No.42156273[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 #
3. mpweiher ◴[] No.42161058[source]
What makes you think I didn't?
replies(1): >>42163197 #
4. em-bee ◴[] No.42163197{3}[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 #
5. mpweiher ◴[] No.42170518{4}[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 #
6. em-bee ◴[] No.42171329{5}[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 #
7. mpweiher ◴[] No.42177918{6}[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 #
8. ◴[] No.42179158{7}[source]
9. em-bee ◴[] No.42179190{7}[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 #
10. mpweiher ◴[] No.42181028{8}[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.