Re:RubyMotion Goes 2.0 And Gets OSX Support, Templates and P...
by rimantas on Thursday May 09, 2013 @01:01PM
(#5681535)
With latest versions of XCode it is possible to use foo[5] instead of [foo objectAtIndex:5] and foo[@"bar"] instead of [foo objectForKey:@"bar"];
There are also array and dictionary literals @[…], @{…} and you can also just type @1 to get NSNumber from primitive.
[ Parent
| on HN ]
Re:RubyMotion Goes 2.0 And Gets OSX Support, Templates and P...
by kemiller on Thursday May 09, 2013 @01:10PM
(#5681596)
I'm aware of all that, but of course you DO want to show things to the outside, all the time. I also know about the newer syntax, which is awesome the few times I still dip into ObjC, but I'm more thinking of map/each/select/detect/etc. There are builtin methods for doing those, but their sheer verbosity tends to discourage the sort of free and easy chaining that Ruby encourages. (Some might argue that's a benefit. Not me.)
Cocoa is a fantastic system to build on top of. NSDate is MILES better than the Ruby time stuff, for example. NS/UI solid core plus Ruby's flexible syntax and culture of sensible defaults is a marriage made in heaven.
Re:RubyMotion Goes 2.0 And Gets OSX Support, Templates and P...
by gdubs on Thursday May 09, 2013 @01:38PM
(#5681802)
>> I'm aware of all that, but of course you DO want to show things to the outside, all the time.
Well, there's a solid argument to be made in favor of limiting how much internals are exposed to other objects. I personally like keeping my headers as minimal as possible.