3 ms·
Kneejerk criticism first. First question I asked myself: What does programming the Smalltalk-style message sending interface look like? What does [dict setObje
by billjings 16y ago
Kneejerk criticism first.
First question I asked myself: What does programming the Smalltalk-style message sending interface look like? What does [dict setObject:x forKey:y]; look like?
It looks like this:
dict:setObject_forKey(x, y);
Well.. okay. I know some people dislike the message sending syntax, but the API is written for that syntax. This is verbose, but readable (if you're familiar with Cocoa):
- (NSIndexPath )tableView:(UITableView )tableView targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath )sourceIndexPath toProposedIndexPath:(NSIndexPath )proposedIndexPath;
This, on other hand...
function tableView_targetIndexPathForMoveFromRowAtIndexPath_toProposedIndexPath(tableView, sourceIndexPath, proposedIndexPath);
...is... not winning the fight, let's say.
Second: what on earth is this:
function crunchCookie(self, sender)
self.button = self:view():viewWithTag(1)
self.button:setImage_forState(UIImage:imageNamed('cookie-crunched.png'), UIControlStateNormal)
self.label = self:view():viewWithTag(2)
self.label:setHidden(false)
end
Is this Android programming now? Do I have to fish my widgets out by hand?
Anyway, this still looks pretty cool. Hooking up a garbage collected scripting language on top of Obj-C with minimal memory overhead is awesome.
- protomyth 16y agoI know it is a personal thing, but I actually like the Smalltalk-style message system. I don't spend as much time look things up. It is interesting now that iOS gains enough popularity to attract enough people who prefer C/C++ style message syntax. Apple did the property thing to help, but It still feels a little weird.