|
I think a lot of the complaints about having to use ObjC come from folks that (a) find it inferior to one or more languages they already know (Python, Ruby, etc.) and/or (b) feel it is somewhat of a platform ghetto (effectively only used on iOS and Mac) and therefore not as efficient use of one's time investment as another language and stack that you can use on many other platforms, and for many other types of applications. The biggest problem with Objective-C, in my opinion, is that the syntax and philosophy is a step backwards in time in terms of programmer friendliness. It is so much more verbose and clunky compared to Python, for example. Use Python's built-in dictionary type a while, then be forced to use Objective-C's dictionaries. Yikes. Then the memory model is more complex and more prone to error due to inconsistent lifecyles and naming conventions. The XCode/iOS project model, build generation and signing crud is just nasty compared to how you can develop and deliver web apps to production in, say, Python, or even desktop apps. It's just a nasty and overly complicated rat's nest of special cases. I counted once and an iPhone app has something like 8+ different names or identifiers, each used in subtly different ways in different places, just asking for confusion and conflict. I ship a desktop app or web app and I have effectively one or two identities to deal with, and no Apple hoop-jumping to do, no publication delays, no long silly list of things I can and cannot do, etc.: heaven in comparison. And no it's not about learning something new. I'm personally on like my 8th language used professionally, and love learning new things. But sometimes "new" things are worse than what you already know. In that case, learning that new thing is bad, and a poor use of your time. I've learned enough Objective-C to be productive, but also enough to know it's a step backward from some other tools in my toolbox, so bad use of my time in an ideal world. I'm thrilled about Apple's change today because it raises hope I might be able to use a sexier language than ObjC/C/C++. |
Reference-counted memory management might be step back, but I don't agree about inconsistent object lifetimes. Cocoa has simple rules: you're responsible for releasing objects returned by methods with `init`, `new` or `copy` in name. delegates are not retained. Everything else is retained and autoreleased for you. It's pretty consistent and even clang's static analyzer can catch common mistakes.