Theocacao
Leopard
Design Element
Comment on "Objective-C, Ruby and Python for Cocoa"
by Jesper — Feb 20
Good post. Definitely a good post.

Typing is important. Writing clean code is important. I never thought I'd say this, but having coded in C# 2.0 and used generics, it's clearly a good alternative to many duck typing techniques. (And also a reminder: yes, I know that doing id foo here and id bar there isn't duck typing - it's very loose standard typing.)

Just the ability to have an ad-hoc created, dynamically specified list type for containing, say, strings, is a good idea. Being able to pass in dictionaries and their own types, and being able to create a subclass and pass in a set type for that (like saying HTTPHeaderDict : Dictionary<String, String>) is priceless. Both Objective-C and Ruby are missing out on this. (In the same way, I might add, that C# is missing out on do-the-right-thing method dispatch - my god, it's full of modifier keywords!)

And I think it's important to qualify, to state as fact so that this subtle point isn't lost, that the reason people want to use Ruby or Python is not because people want to hide from specifying types. (It's probably not what you think personally, I'm not claiming you argued it, but if one wanted to hard enough, I think one could take it away from this article. )

For me, it's not a question of whether Objective-C is a good language, or even the best language to do Cocoa in. It's simply a question of: are there cases where using Ruby or Python would be significantly better? And the answer is: yes, definitely, of course. Are there cases where novices or adverse square bracket allergics could write their whole apps in those languages? Yes again. I'd recommend against that on the merit that every language should do what it's best at, and there's going to be a whole lot of what we call 'pure Cocoa' in there that Objective-C will be best at, but it'll certainly be possible.

Personally, the bridges are all about these two things. Making it easier for *me* to use Ruby when I need to, and making it easier for folks only familiar to Ruby to use it as much as possible when they start to use Cocoa. I think most people like Objective-C, and especially what it'll do for them in terms of 'getting' Cocoa, after using it for a while. But you just don't wake up one morning and sit down and learn it, you have to ease into it, which is another reason why it's very important for Apple that there's always a bridge.
Back to "Objective-C, Ruby and Python for Cocoa"
Design Element

Copyright © Scott Stevenson 2004-2015