I use both Java and Obj-C at work. Objective-c suffers from its C heritage.
1. Pointers (just not useful or needed these days)
2. Memory-management (you don't get ARC unless you're happy to not cater for users using <5.0 (apparently this may not be true. thanks for the comments), and even with ARC you still need to do more than you do in Java)
3. Message-passing (Not bad per se, apart from this: you can send any selector to a nil object, meaning your app will fail silently in many instances. And that is huge.)
4. Header files (the #import is an advantage over usual C, but it's still a pain to remember to import any object before using it)
5. A hodge-podge of syntax: it's smalltalk-inspired syntax, with the more recent dot operator, with the usual C syntax.
6. Painful process of defining/declaring variables. Usual initiallisation, the @property, then @synthesize then initilise it in init: then nil it in viewDidUnload:, then decalloc it in dealloc:.
7. masklinn's point about Namespaces is important, too. Making a library with the standard three letter prefix on every class seems very hackish.
8. masklinn's point about the 'id' variable catch-all also: its very often misused. And your code is full of class checks.
I can live with those things. And that's even if they do make Java look like a nice language. What I really hate is Xcode. (And used to HATE eclipse before encountering Xcode)
1. After you get use to Eclipse's intellisenseque features, using Xcode is like wading through treacle. As one example, initilising a new member field is 1/2 a second job. In Xcode, you have to do what was in the last bullet point. For. Every. Single. Variable.
2. It's debugger/variable inspector, compared to Eclipse, is substandard.
3. Xcode crashes. Often.
4. It just doesn't feel as fast as Eclipse.
5. The debugger can hang on the iPhone a lot, meaning you need to turn it on and off quite often. It's okay in the simulator, I've found.
Regarding ARC: it's handled purely at compile time and works fine with iOS 4 (modulo weak references).
ARC is supported in Xcode 4.2 for Mac OS X v10.6 and v10.7 (64-bit applications) and for iOS 4 and iOS 5. Weak references are not supported in Mac OS X v10.6 and iOS 4.
1. Took a while to get used to but if you don't like pointers then yeah I understand.
2. In iOS (especially before the iPhone 4) memory management is one of the things that allows it to be as smooth as it. Adding GC overhead will eat up precious resources. On desktop this is usually masked by the absurd amounts of RAM most modern machines have.
3. Message-passing is one of the best things about Objective-C. You no longer have to perform null checks because if you structure you code correctly it will continue gracefully. The dynamic nature of Objective-C is what I love most about it.
4. I love the verbose syntax but that is a personal thing I guess. I love structuring my code and selector names so that everything almost reads like a paragraph of text.
I think we have to agree to disagree about Eclipse. I've been using it since University and I much prefer Xcode to Eclipse. To me Eclipse is the slow behemoth eating up my system memory.
I can understand the variable inspector. The GUI in Xcode is throwaway but once I got used to gdb I've grown to like it.
Xcode 4 crashed like crazy. It looks like they've finally stabilized it but I can't deny that the first 4 months after Xcode 4 was migraine inducing.
1. Pointers (just not useful or needed these days)
2. Memory-management (you don't get ARC unless you're happy to not cater for users using <5.0 (apparently this may not be true. thanks for the comments), and even with ARC you still need to do more than you do in Java)
3. Message-passing (Not bad per se, apart from this: you can send any selector to a nil object, meaning your app will fail silently in many instances. And that is huge.)
4. Header files (the #import is an advantage over usual C, but it's still a pain to remember to import any object before using it)
5. A hodge-podge of syntax: it's smalltalk-inspired syntax, with the more recent dot operator, with the usual C syntax.
6. Painful process of defining/declaring variables. Usual initiallisation, the @property, then @synthesize then initilise it in init: then nil it in viewDidUnload:, then decalloc it in dealloc:.
7. masklinn's point about Namespaces is important, too. Making a library with the standard three letter prefix on every class seems very hackish.
8. masklinn's point about the 'id' variable catch-all also: its very often misused. And your code is full of class checks.
I can live with those things. And that's even if they do make Java look like a nice language. What I really hate is Xcode. (And used to HATE eclipse before encountering Xcode)
1. After you get use to Eclipse's intellisenseque features, using Xcode is like wading through treacle. As one example, initilising a new member field is 1/2 a second job. In Xcode, you have to do what was in the last bullet point. For. Every. Single. Variable.
2. It's debugger/variable inspector, compared to Eclipse, is substandard.
3. Xcode crashes. Often.
4. It just doesn't feel as fast as Eclipse.
5. The debugger can hang on the iPhone a lot, meaning you need to turn it on and off quite often. It's okay in the simulator, I've found.