3 ms·
You are right, compared to C++ and C ObjC has advantages. But compared to other langues it has major drawbacks. Here are some reasons I don't like Objective-C (
by probablycorey 16y ago
You are right, compared to C++ and C ObjC has advantages. But compared to other langues it has major drawbacks. Here are some reasons I don't like Objective-C (these mostly apply to iPhone dev only)
- Header Files: These are archaic and require you to repeat code unnecessarily. Don't require humans to do something that computers are better at.
- No Automatic Garbage Collection: On the ObjC 2.0 we have this, but not on the iPhone. Unless you are making a high performance game, there is no reason the phone can't handle Automatic GC.
- No NSDictionary/NSArray literals: [[NSDictionary alloc] initWithObjectsAndKeys:@"value", @"key", @"value2", @"key2", nil]; // Enough said
- No regex: You kind of get regex's in 3.2, but they are very limited. Regex literals are much more powerful
- Xcode: You are pretty much required to use Xcode and I don't like Xcode. Even if you use the "xcodebuild" command-line script, you still have to create the project through Xcode.
- Closures: I guess we will be able to use these soon, but it is going to take awhile for all the API's to get updated to accommodate them.
- No dynamic variables: It's handy to be able to shove data into objects sometimes. It's a hack, but as long as you treat it as such you can save a lot of needless code. (You can do this via the ObjC runtime, but it's messy)
- No namespacing: ObjC handles namespaces by prefixing class names. Blah, that is so 1978.
- Unit Testing: ObjC has the poorest excuse for unit testing out of any language I've ever used.
- wrs 16y agoIt's not technically a language thing, but I can't get used to the unbelievable verbosity of the method names. (And for calibration purposes: I used to do a lot of Common Lisp.) In a language inspired by Smalltalk, they turned "at:" into "objectAtIndex:"?