4 ms·
I have a deep fondness for Objective-C, which always struck me as a much more elegant way to bridge the C/OOP divide than C++.
by jfb 5y ago
I have a deep fondness for Objective-C, which always struck me as a much more elegant way to bridge the C/OOP divide than C++.
- mhd 5y agoSure it was more elegant, it took its inspiration from SmallTalk after all ;) Of course that lead to a bit of a mixed result. For one, most of the new features were syntactically isolated to the Obj-C square brackets. On the other hand, within those brackets things were considerably un-C-like. object.method(arg) seems more "native" than [object method:arg]. I actually liked this grafted-on appearance. It was a clear signal that said: Yeah, we're still C, let's not make any illusions about this. By comparison C++ had more delusions of grandeur, almost from the start. This is also why I'm not that fond of almost any changes to Objective-C that were made later, especially by Apple. That includes the various searches for better memory management, but also the property dot syntax. I'm still a bit sad that the Objective-Javascript thing never took off. Way better than most of the added language features since then.
- jfb 5y agoOne of the best things about OS X (as it used to be called) is that the runtime was accessible not just from Objective-C, but also from ruby or python or JavaScript. It was very cool to be able to fire up a repl and go exploring in the innards of the various frameworks.
- wues 5y agoYes, the distinction between class and instance methods in an interface with + and - characters must be one of the most elegant solutions introduced in a programming language ever. Seriously, I could never understand this claim of "elegance" of Objective C…
- jfb 5y agoReally? Whinging about syntax? You don't understand how cleanly dividing the C bits and bobs from the Smalltalk-derived object system by using distinct syntax could be considered a more elegant solution to the problem than C++'s insistence in rooting both worlds in a single hierarchy of functionality?