Behind enemy lines: 3 months as an iOS developer at Google
As an Android developer who's required to learn iOS just to port one of my projects, I do find Objective-C's syntax to be strange--quite sloppy, in fact. I tried to list down the things I don't like about the language while going through my reference, and here are some of them so far:- Defining the method signatures in a header file or an @interface section, then repeating the same method signatures just to implement them in @implementation. I just think it's an awful waste of effort.- The idea of categories. The way I see it, there doesn't seem to be a reason not to subclass since categories won't make sense anyway if you don't include the original class in #import.- @optional directive in protocols. I think of protocols as Java interfaces, and I assume that's the intended purpose for having them, so having an @optional directive seems quite pointless to me.- Obscure variable scoping. I find myself having to memorize too many visibility rules--ones that apply to the objects themselves (what attributes they inherited, local/block scoping, etc.), ones that apply to files themselves (defining instance variables within @interface, global BUT in-file variables within @implementation, the extern keyword, etc.). This is much simpler and elegantly done in Java where you don't need to switch between thinking of your program as a bunch of interacting objects and as a bunch of files.- Which makes me think that Objective-C just doesn't have good OOP in the first place.- Conditional compilation. When is this ever useful? I just can't visualize having to write this (maybe for games?), but again, I never had to do this in Java.