Where @"..." is a shorthand for a constant NSString
And then the next thing to add could be a number...
NSNumber * age = [NSNumber numberWithInt:18];
[container setObject:age forKey:@"age"];
Then add in an NSDate, or another NSDictionary, or NSArray type....
The standard library that comes with ObjC is really powerful, and since it's ubiquitous, it works really well across a range of apps.
And then there are some really nice design patterns. Create an NSNotificationCenter and enjoy the Observer pattern, tightly integrated into the event loop. Any object can notify any other simply by posting a notification, and any object can listen for them by registering interest. And since collections can store anything, it's easy to pass state around and make large applications work well without interdependency hell. Just one of the built-in nice things... And all without caring about memory management.
I think you’re making my case for me. All of that seems easy and straightforward to you, but not to me. It’s worth noting that I struggle similarly with C++ and Rust. I just think the syntax is harder to read than a Java or a C# or a Python.
I agree that Java isn’t pleasant to work in- but not because of the syntax. It’s everything else, like the JVM, Oracle’s shenanigans with licensing, etc.
How about generic containers that can store any object ? Even using the old syntax, it's pretty clear what's going on
NSMutableDictionary *container = [NSMutableDictionary new];
NSString * item = [NSString stringWithUTF8String:"hi there"];
[container setObject:item forKey:@"greeting"];
Where @"..." is a shorthand for a constant NSString
And then the next thing to add could be a number...
NSNumber * age = [NSNumber numberWithInt:18];
[container setObject:age forKey:@"age"];
Then add in an NSDate, or another NSDictionary, or NSArray type....
The standard library that comes with ObjC is really powerful, and since it's ubiquitous, it works really well across a range of apps.
And then there are some really nice design patterns. Create an NSNotificationCenter and enjoy the Observer pattern, tightly integrated into the event loop. Any object can notify any other simply by posting a notification, and any object can listen for them by registering interest. And since collections can store anything, it's easy to pass state around and make large applications work well without interdependency hell. Just one of the built-in nice things... And all without caring about memory management.