3 ms·
I've used countless languages professionally, but I only ever fell in love with Objective-C. Protocol Oriented Programming is sorely underutilized outside of it
by ramesh31 3y ago
I've used countless languages professionally, but I only ever fell in love with Objective-C. Protocol Oriented Programming is sorely underutilized outside of it. And the subtle difference between message passing and method calling is an abstraction that totally changes how you think about building things in an object oriented environment for the better. There's nothing else I've found which has that amount of low level power (with the ability to drop into C at any time), while still having a world class, well documented OOP framework (NS) on top of it. And ARC is the perfect middle ground between manual maloc and a traditional mark/sweep GC. The power and ergnomics of that language were probably almost single handedly responsible for the early success of the App Store.
- gmac 3y agoI haven’t used Swift enough to comment on the contrast, and I do sometimes wish for a bit more type inference in Objective-C (rather than having to keep clarifying that yes, -stringByReplacingOccurencesOfString:withString: is going to return [… drumroll …] a string). But I must admit that I too have a huge soft spot for Objective-C. Including those beautifully unambiguous selector names.
- happytoexplain 3y agoAgreed - though I prefer Swift, I loved my time with ObjC, and I can't say I even like any other language I've ever touched. There's no close 3rd place for me. And the gap widens when you take the ecosystems/frameworks into account. One thing I never really grokked though is the practical implications of message-passing vs method-calling. I read plenty of material about how it's implemented, but never found a scenario where I thought about it. Everything was always still just method-calling to my forebrain. Do you have any resource that talks about the practical implications?
- ramesh31 3y ago>Do you have any resource that talks about the practical implications? From the man himself, Alan Kay: https://news.ycombinator.com/item?id=1355977 https://news.ycombinator.com/item?id=1355977