Actually, I think your code examples support my point. You're not contrasting Ruby and Objective-C, you're contrasting Ruby's standard library with the Objective-C library Foundation, which is what you need to learn to get any real use out of MacRuby/RubyMotion. Here's the MacRuby/Cocoa version of that code:
error = Pointer.new_with_type '@'
regex = NSRegularExpression.regularExpressionWithPattern("foobar(\\d*\\w)", options: NSRegularExpressionCaseInsensitive error: error)
match = regex.firstMatchInString(string, options: 0, range: NSMakeRange(0, string.length))
NSLog "The limits of my language define the limits of my world - Wittgenstein" if match
Do you really feel that Objective-C is the biggest difference between the three examples?BTW, if it sounds like I'm trying to say RubyMotion is pointless, I'm not. I'm just saying that "I don't want to go to the trouble of learning Objective-C" is a weak reason to use RubyMotion, because you'll have to do 99.95% of the same work anyway.
The example was supposed to illustrate that some things are easier and more concise in ruby, and thus also presumably in something like Rubymotion. The relevance to your posts is that you are ignoring some very good reasons to use ruby in your focus on the cocoa api - not all programming in ios consists of calls to the api so learning it is not the only thing required to make an iPhone app. In some apps api calls might make up half of the code, with the rest being back-end stuff. Evidently Rubymotion does not mean you can avoid learning the api, it just helps you write the rest of your code in a preferred language while painlessly calling the apis to show stuff on the screen. Not having to deal with Xcode would be a bonus too.
> "I don't want to go to the trouble of learning Objective-C" is a weak reason to use RubyMotion, because you'll have to do 99.95% of the same work anyway.
The fact that Ruby can express things very concisely has nothing to do with whether or not learning Objective-C adds an appreciable amount to time to the process of learning Cocoa. That's why I was ignoring it. If you simply like Ruby on its own merits, that's a good reason to use it.
Here's the disconnect. That was never my point.
Please re-read my initial comment. You responded to that comment, hence you're responding to my initial point, which has nothing to do with your argument.
Do you get it?
The problem is your just not able to express your point, clearly, in relation to the context of this topic. Maybe face-to-face, verbally, you'd do a brilliant job of it. But in the written form, well... Not so good.
A little humility on your part would go a long way. Just saying ;)
For example, consider using regular expressions in Ruby to check a string -
or in Objective C: Until quite recently it wasn't even possible to do this in ObjC without an external library.