Re:Non-Apple's Mistake
by elai on Friday April 16, 2010 @07:11PM
(#1272226)
Yes, something to replace the super crufty NSArray / NSMutableArray / NSSet / NSDictionary, syntax would be really good. Small talk message passing was meant to have short, small one symbol binary operators, but unfortunately that elegance is not there in objective c.
[ Parent
| on HN ]
Over the life of the code, I'm only gonna type it once; I may read it a hundred times.
To be honest with you [[stuff objectAtIndex:5] objectForKey:@"name"] is less readable than stuff[5][@"name"]. And you type this kind of code constantly over and over again, it can really stack up and create something that would be simple to read in other languages.
Except that if you're used to Smalltalk, this is just standard fare.
I agree that a Python-like shorthand would be great at the object level, but then you'd have a mixture of shorthand and longhand, and that would be ugly.