@interface MyClass
- (NSDictionary *)createSimpleDictionary;
@end
@implementation MyClass
- (NSDictionary *)createSimpleDictionary
{
return @{
@"keyForNumber": @1,
@"keyForBool": @YES,
@"keyForArrayOfStrings: @[@"one", @"two", @"three"]
};
}
@end
How much cleaner could this be if we dropped C backwards compatibility! We could remove the header file, and get rid of all the *'s and @'s: class MyClass
- (NSDictionary)createSimpleDictionary
{
return {
"keyForNumber": 1,
"keyForBool": YES,
"keyForArrayOfStrings: ["one", "two", "three"]
}
}
end
This new language would get rid of many warts of Objective-C, bringing it up to speed with modern languages, while keeping performance and interoperability with the Cocoa toolchain.There may be some perfect, completely new idea for a programming language out there, but Apple would never go for it. Developer experience is a distant third to the User experience and the Apple experience, and the only thing they will go for is an evolutionary, backward compatibile change such as this.