←back to thread

107 points wmlive | 1 comments | | HN request time: 0.394s | source
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. igouy ◴[] No.42229232[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?