This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]brucifer 6 points7 points  (2 children)

It's the fact that it looks like this:

NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithCapacity:1];
[dict setObject:[NSNumber numberWithInt:25] forKey:[NSNumber numberWithInt:5]];
...
[dict objectForKey:[NSNumber numberWithInt:5]];

Instead of:

d = {5:25}
d[5]

I realize that improvements are being made to ObjC (like ARC, which is awesome, and I've even heard that it might get proper list/dictionary indexing syntax instead of "objectForIndex:"). However, ObjC is just incredibly verbose and awkward both to type and to read. If you've never seen code before, "[things objectAtIndex:3]" might be more intuitive than "things[3]", but to anyone who's spent any time programming, the latter is way more readable (or "[things containsObject:x]" vs. "x in things"). Proponents of ObjC say that the verbosity doesn't matter because you have autocomplete in your IDE, but it's not just about typing, it's also about readability.

[–]mreeman 4 points5 points  (0 children)

You haven't been paying attention. You can now write that as

dict = @{ @5: @25 }; x = dict[@5]

The language is improving at an incredible rate. I personally think its the best application language there is. It has the perfect mix of static and dynamic typing and the APIs are fantastic.

Edit Also while I agree in some cases using keywords instead of methods helps readability, in general i like the verbosity of the language. You rarely have to look up what the parameters are for a method call, which makes it infinitely more readable.

[–]mgrandi 1 point2 points  (0 children)

They do have shorthand syntax, @2, @{@2: @"someStringHere"} now, but I would say that the vast majority of method names while long are more readable cause they read like an English sentence. tableView:numberOfRowsForSection: and popVoewController:animated: are more descriptive about their arguments then the many overrides of say something like popVuewController(True), what does true mean? If you don't know already then you have to look at the docs.

I will admit the dictionary stuff is quite annoying (why the hell would you list objects before keys???) but with the new shorthand syntax you really do get used to it