3 ms·
Objective-C is a bit irritating in it's dictionary & array/list syntax, it turns something that would be 20 characters in python or even java into something tha
by elai 16y ago
Objective-C is a bit irritating in it's dictionary & array/list syntax, it turns something that would be 20 characters in python or even java into something that is 100-150 characters. Similarly in string editing and xml parsing. TouchJSON works very quickly, but then you run against the obtuse array & hash table syntax when using it's result. Give us smalltalk binary & one character operators! The obtuse syntax hurts readability too.
- jsolson 16y agoYou may find the following useful: #define A(obj, objs...) [NSArray arrayWithObjects:obj, ## objs , nil] #define D(val, key, vals...) [NSDictionary dictionaryWithObjectsAndKeys:val, key, ## vals , nil] I put these two macros in the prefix header for every Objective-C project I do. Say what you will about single character macros, these save me time and improve readability (for me, anyway... I'm not sure how others reading my code down the road fare, but so far there haven't been many of those).
- elai 16y agoOne of those obvious things that you feel stupid for not realizing. Thanks!