Seriously, how would you get a list of all functions in a module without an IDE? Besides, I put all my documentation into h-files as well, so other devs can pretty much see what I am doing without ever glancing at c-files.
With Ruby or Java you need some advanced folding support in your editor or a full-fledged IDE.
These "people" don't also seem to get when you distribute a lib, you need to distribute headers with them.
I just wish I could use it for iPhone development. :)
#define NSDICT(...) [NSDictionary dictionaryWithObjectsAndKeys: __VA_ARGS__, nil]
#define NSARRAY(...) [NSArray arrayWithObjects: __VA_ARGS__, nil]But good enough to write major parts of an operating system in by a company full of people easily smarter than you? Say what?
> Header Files
It's C for chrissakes.
> No GC on the iPhone
Because it's a performance penalty. Clock cycles on a phone are vastly more important than on a desktop/laptop. I can guarantee you this will change in a few years.
> No NSDictionary/NSArray literals
It's not a scripting language. Show me array literals in C or C++ that map to an underlying collection class that gives you fast enumeration and then we talk.
> Xcode
Personal preference.
> Closures
They're called Blocks.
> No dymanic variables
It's called 'id'.
id whatever = [[YourObject alloc] init];
But even better: id whatever = [[NSClassFromString(@"YourClass") alloc] init];
Or how about setting properties on objects dynamically? [yourinstance setValue:@"Hello" forKey:@"property"];
Or dynamically dispatching methods?Ever messed with vtables in C++?
> Unit Testing
Agree, but that's changing.
> No namespacing
You bitch about all the typing, but you want to type out namespaces instead of using a prefix on your classnames. Ok ...
Your confusing ObjC with Ruby, Python, et al. But it is not any of those. Like I mentioned elsewhere, it's a high level layer on a low level language. Adjust your expectations accordingly.
Here are some reasons I think Objective-C needs to be retired:
- Header Files: These are archaic and require you to repeat code unnecessarily. Compiler's shouldn't require humans to do something that computers are better at.
- No Automatic Garbage Collection: In 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 and require around 3-4 lines of setup to get anything done.
- Xcode: You are pretty much required to use Xcode and I don't like Xcode. Even if you use the "xcodebuild" CLI, 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)
- Unit Testing: It barely exists and is difficult to use.
- No namespacing: ObjC handles namespaces by prefixing class names. Blah, that is so 1978.