(no title)
rbarooah | 13 years ago
1. The object model is similar in complexity to Java (i.e. no multiple inheritance, templates, etc. that fill C++ with corner cases).
2. It is C but with an object oriented message passing layer on-top. You can think of an Objective-C program as a bunch of C programs that have a more loose coupled way of talking to each other. This gives it a balance between the abstraction of a high-level language and the performance and control of C that is different from Java and most scripting languages where you need to use a native-API to talk to C. Whether this is objectively good or not is debatable but it certainly supports Apple's strategy. Personally I find it liberating.
3. The dynamism and looseness of the language make code transformation tools much harder to write - which is why XCode is only now starting to approach Eclipse on refactorings and completion. The upside is the dynamism enables a bunch of things whose equivalents require bytecode manipulation in java - e.g. property observers, Core Data synthesized accessors, Undo proxies etc.
Java is evolving slowly to make these kinds of thing easier, and Objective-C is evolving slowly to a tighter language that's more amenable to automated transformation.
These are just a few reasons. I think it's also fair to say that Objective-C was pretty crude and was 'behind' even as recently as 2007, but the rate of improvement since then has been high and has brought it up to date. (Declared properties, blocks, ARC, GCD, are pretty major steps into the modern era)
There are definitely a lot of rough edges that still remain and there's a lot more to learn than say a scripting language, plus a very different philosophy to get to grips with by comparison with the java family but once you do know it, it's a powerful language with some great strengths.
I'm very interested to see what happens to it over the next few years.
primitur|13 years ago
That said, for all your very valid points about Objective-C, the same (essentially) can be said of Lua, and the Lua VM, for example.
As a mobile developer, I'm no longer interested in Objective-C - its only an Apple Language. But I can take the Lua VM and put it on all the other machines, host-wise/parasitically, and create my own internally ordered Framework which runs on all Platforms, and still gain a lot of the benefits of a re-evaluation of 'language simplicity' versus programmer effectiveness.
After 4 years of Mobile development on iOS and Android, where multiple projects have blossomed organically into unwieldy godawful trees of complexity which prove, every day, even more difficult to turn over to other programmers, themselves creating massive WordSpaceCollections: ofCode.to_BeMaintained((Some*)Way) || Other { NSLog("grr..", &etc} ;
On a Drama Scale, it goes like this:
"Oh, Android NDK/SDK, how you have blossomed to being something I regret I am not putting into the trash in the early days. XCode, you %(#@&% Asshole piece of software, Why I Gotta Download CMDLineTools just to get work done"
..
"SublimeText2, factory settings .. Open Folder->".lua files", build and distribute for MacOSX, Linux, Windows, iOS, Android, and still only need to maintain one codebase.
tl;dr - You can't do that with Objective-C.
rbarooah|13 years ago
The question I was responding to was simply whether there are compelling reasons for Apple to use Objective-C.
Supporting cross platform native development is clearly not a strategic goal for them.
I think I'd add another reason - which is that they are in control of the evolution of Objective-C.