by pianoben · 4y ago · 0 comments
Another perspective is that the syntax of Obj-C exposes and supports the core model of the language, which is objects sending messages to each other. That it happens to be fast to parse seems secondary, and certainly further developments since version 2.0 have made parsing slower, not faster.
In my experience people complain about Obj-C syntax when what they actually dislike are verbose Cocoa/Foundation/etc APIs. Try their C Core* equivalents and you'll find you probably dislike those, too.
If so, that’s a real shame. Foundation may be the single best-designed standard library for a (non-functional) language ever.
One CoreFoundation example at random:
CFURLRef CFURLCreateCopyDeletingLastPathComponent(CFAllocatorRef allocator, CFURLRef ref);
I think nearly everyone who reads that prototype will immediately understand what it does, but there's no denying it's a mouthful.Tack on some unfamilar square-brackets and intersperse argument names, and it's understandable that people will conflate the syntax with the APIs.
I don't mention immutable by default behavior because it was long ago and written in C.