I've decided to use an upcoming sabbatical to teach myself OS X and iOS programming. My background includes OS X systems administration and web development, mostly using the Apache/MySQL/PHP model. I'm familiar with OOP concepts and have trifled with any number of languages from C to AppleScript, but am not fluent in any object oriented language. I've been exploring Xcode 4 for a week and feel conversant with the IDE if not yet able to accomplish anything with it. So… I understand that Cocoa is a given, but today's million dollar question is Objective-C or MacRuby? I'm a blank slate with regard to both and so could use some good advice. For example… What are the advantages of MacRuby over Objective-C? What are the advantage of O-C over Ruby? Is Xcode's support for O-C significantly better than it's handling of Ruby? Do I care? At this point I'm primarily interested in OS X development, but iOS clearly needs to run a close second. What's the current status of Ruby development for iOS and is it likely to go anywhere in the nearish future? Any thoughts on the longer-term prospects of either language? Any thoughts from anybody will be much appreciated. Thanks, Bryan
Just a suggestion but I think having a goal will determine what you use. MacRuby will still expose you to the Cocoa libraries so you will be able to interchange with OBJC easily. The MacRuby style tho gets my vote... e.g. (OBJC) NSMutableDictionary* myDict = [[NSMutableDictionary alloc]init]; (MacRuby) mydict = {} it may just be a verbosity thing but once you get used to the Macruby style OBJC becomes tedious. heres hoping with multiple cores etc that a garbage collector can be added to IOS! which I think is the only reason MacRuby would not work with it. Terry On 31/03/2011, at 4:43 PM, Bryan Harrison wrote:
I've decided to use an upcoming sabbatical to teach myself OS X and iOS programming. My background includes OS X systems administration and web development, mostly using the Apache/MySQL/PHP model. I'm familiar with OOP concepts and have trifled with any number of languages from C to AppleScript, but am not fluent in any object oriented language. I've been exploring Xcode 4 for a week and feel conversant with the IDE if not yet able to accomplish anything with it.
So… I understand that Cocoa is a given, but today's million dollar question is Objective-C or MacRuby? I'm a blank slate with regard to both and so could use some good advice. For example…
What are the advantages of MacRuby over Objective-C?
What are the advantage of O-C over Ruby?
Is Xcode's support for O-C significantly better than it's handling of Ruby? Do I care?
At this point I'm primarily interested in OS X development, but iOS clearly needs to run a close second. What's the current status of Ruby development for iOS and is it likely to go anywhere in the nearish future?
Any thoughts on the longer-term prospects of either language?
Any thoughts from anybody will be much appreciated.
Thanks, Bryan _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
On Mar 30, 2011, at 9:56 PM, Terry Moore wrote:
it may just be a verbosity thing but once you get used to the Macruby style OBJC becomes tedious.
Hell, I spend most of my time in C++, and I find the ojbc verbosity to be tedious ;-) -- Scott Ribe scott_ribe@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice
Greetings, Hell, I spend most of my time in Java, and I find the objc verbosity to be...uhhh...pretty familiar. ;) Joking aside, I'll often take common ObjC patterns and 're-do' them the Ruby way so they're more efficient to the way my brain works. As an example from a recent bit of code, you have: NSArray *dropTypes = [NSArray* *arrayWithObjects:"BookmarkDictionaryListPboardType", "MozURLType", NSFilenamesPboardType, NSURLPboardType, NSStringPboardType, nil]; versus dropTypes = ["BookmarkDictionaryListPboardType", "MozURLType", NSFilenamesPboardType, NSURLPboardType, NSStringPboardType] The first is remarkably flexible in rare cases, but exceptionally annoying for the common case. To try and answer the questions, though... - What are the advantages of MacRuby over Objective-C? - An easy to learn, concise syntax in a language designed for the pleasure of programming but with enough power for all but the toughest problems - Being interpreted means you can try things very quickly, and not have to go through a compile cycle for each time you just want to see how something works. - A ton of 'gem' libraries that do very cool things in natural way - What are the advantage of O-C over Ruby? - Compiled, so marginally faster (although MacRuby's compilation is getting better) - All the examples of doing MacOS X programming out there are in Objective C, so you have to translate - A decent number of native libraries which, while you can use them in MacRuby, are easier to use in Objective C - *iOS programming* - Is Xcode's support for O-C significantly better than it's handling of Ruby? Do I care? - Yes, it is better. No, I don't find it better enough that I care very much. Symbol completion doesn't work great in MacRuby, but it doesn't bother me much. - At this point I'm primarily interested in OS X development, but iOS clearly needs to run a close second. What's the current status of Ruby development for iOS and is it likely to go anywhere in the nearish future? - The garbage-collection requirement makes this a non-starter right now. It might get better, *it might not.* I do iOS programming in Objective C, and Mac OS X programming in MacRuby. It helps me keep my hand in Objective C development, so I'm always able to translate between Objective C and MacRuby, while letting me build a desktop app in my favorite language of all time, so far. :) - Any thoughts on the longer-term prospects of either language? - Ruby itself is likely to remain a strong contender for many years. MacRuby has just started being shipped, albiet as a private framework, by Apple. This bodes well, but as the Java OS X developers can tell you with a touch of sadness...things change. Hope that helps some! -- Morgan
I'm not a MacRuby or ObjC expert, but here is my understanding.
What are the advantages of MacRuby over Objective-C?
MacRuby is a variant of Ruby, so it's an interpreted, concise, dynamic language. Objective-C is a compiled language based on C (with a lot of run-time support). So, a MacRuby program will generally be shorter than the corresponding Objective-C program and may be able to do tricks (eg, using metaprogramming) that the ObjC program cannot. That said, an Objective-C program can do anything that a MacRuby program can, though generally with quite a bit more code.
What are the advantage of O-C over Ruby?
MacRuby has JIT (Just In Time compilation), so it will speed up over time. ObjC is a compiled language, so it runs fast from the beginning.
Is Xcode's support for O-C significantly better than its handling of Ruby? Do I care?
Sorry, I don't know.
At this point I'm primarily interested in OS X development, but iOS clearly needs to run a close second. What's the current status of Ruby development for iOS and is it likely to go anywhere in the nearish future?
Ruby expects a garbage collector to be available. iOS does not supply one, so that's currently a show-stopper.
Any thoughts on the longer-term prospects of either language?
ObjC is only used (to a first approximation) by Apple and folks who are programming for Apple environments. Ruby is a popular web development language and it can also be used for general scripting. I don't see either language going away any time soon, but Ruby is a more portable job skill: there are lots of companies who who hire Ruby programmers; there are far fewer companies who hire ObjC programmers. -r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm@cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Software system design, development, and documentation
On Mar 30, 2011, at 8:43 PM, Bryan Harrison wrote:
So… I understand that Cocoa is a given, but today's million dollar question is Objective-C or MacRuby? I'm a blank slate with regard to both and so could use some good advice. For example…
What are the advantages of MacRuby over Objective-C?
What are the advantage of O-C over Ruby?
Well, do bear in mind that you also asked this question in the MacRuby list. Were you genuinely hoping for un-biased answers? ;-) That said, I'll do my best to represent the other side of the argument even though I'm actually an old C hacker (generally avoiding higher-level languages by choice) and have no real personal preference either way. The advantages of ObjC over Ruby are: 1. Objective-C is definitely the main game in town on Mac OS X / iOS. When it comes to interoperability with 3rd party libraries, sample code / tutorials for either platform or documentation, you're generally going to find that ObjC is always first in line as far as priorities are concerned. 2. Objective-C (and/or C at "the POSIX layer") will give you the greatest flexibility in programming for the platform. Whereas Ruby always drags its runtime around with it, the lower-level languages don't have as much baggage and can be used in a wider variety of situations, such as programming for the kernel (C only of course) or creating plug-ins for other systems like Audio Units, Core Graphics Filters, Authorization plug-ins and so on. 3. Most new API comes to C/ObjC first, often being later "wrapped" in MacRuby in some way, but now you have to rely on either the MR folks to get around to it or the new API being introspectable/bridgesupport-able enough to be called without a wrapper. The advantages of Ruby / MacRuby have already been listed by others, though I'm not sure job security is necessarily one of them. I see a lot of job postings for C and ObjC programmers, the various app stores having created something of a "gold rush" for them, just as the web development boom gave Ruby programming a boost through Rails. - Jordan
On 31 Mar 2011, at 04:43, Bryan Harrison wrote:
I've decided to use an upcoming sabbatical to teach myself OS X and iOS programming. My background includes OS X systems administration and web development, mostly using the Apache/MySQL/PHP model. I'm familiar with OOP concepts and have trifled with any number of languages from C to AppleScript, but am not fluent in any object oriented language. I've been exploring Xcode 4 for a week and feel conversant with the IDE if not yet able to accomplish anything with it.
So… I understand that Cocoa is a given, but today's million dollar question is Objective-C or MacRuby? I'm a blank slate with regard to both and so could use some good advice. For example…
What are the advantages of MacRuby over Objective-C?
What are the advantage of O-C over Ruby?
Is Xcode's support for O-C significantly better than it's handling of Ruby? Do I care?
At this point I'm primarily interested in OS X development, but iOS clearly needs to run a close second. What's the current status of Ruby development for iOS and is it likely to go anywhere in the nearish future?
Any thoughts on the longer-term prospects of either language?
Any thoughts from anybody will be much appreciated.
Thanks, Bryan _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
I prefer Ruby because it's easier to prototype quickly. I'm also way more familiar with Ruby, but when I'm writing Objective-C, I feel like I'm battling the language. With ruby, I can just solve problems, the language part comes naturally. By the way, I only got into C/Objective-C recently. it's a work-in-progress, and could have a large part to do with it. On the plus side, if you do choose to dip into MacRuby, the APIs will map almost straight back to Objective-C Cocoa APIs, so it's not a lost cause. There is a benefit in that you'll learn Cocoa APIs, and be able to translate those back to Objective-C if/when you decide to. (The same is true if you learn Objective-C, and then MacRuby of course) I just prefer Ruby because it's obviously my language of preference, and I seem to be able to work quicker with it. Maybe you could try both languages, and see which fits better for *you*? - Rob
Forgive me for not saying "thanks" individually, but you've all been so generous with your time and thoughts that doing so would clutter up the list. ;) If anyone's curious, my immediate reaction is that I'll learn both, starting by devoting a week to each just to get a feel and figure out which one I'd like to pursue to fluency first. Thanks again, Bryan
Hi Bryan, I see that many people responded to that thread, but I would like to still add the following points: 1) MacRuby can't be used for iOS programming at this time. 2) In order to fully program in Objective-C, you must know C first. If you're a seasoned C programmer, picking Objective-C should just take a couple days (maximum). Otherwise, you will have to learn C before, which can be challenging, especially if you come from PHP. Ruby, the language MacRuby implements, is _much_ easier to learn. Using Cocoa from MacRuby does not require you to master Objective-C, you basically just need to learn about Objective-C classes and methods and how to use them in Ruby, then you can spend the rest of your time learning the Cocoa APIs. There is plenty of documentation available, including 2 books (currently being written) on this very specific topic :) HTH, Laurent On Mar 30, 2011, at 8:43 PM, Bryan Harrison wrote:
I've decided to use an upcoming sabbatical to teach myself OS X and iOS programming. My background includes OS X systems administration and web development, mostly using the Apache/MySQL/PHP model. I'm familiar with OOP concepts and have trifled with any number of languages from C to AppleScript, but am not fluent in any object oriented language. I've been exploring Xcode 4 for a week and feel conversant with the IDE if not yet able to accomplish anything with it.
So… I understand that Cocoa is a given, but today's million dollar question is Objective-C or MacRuby? I'm a blank slate with regard to both and so could use some good advice. For example…
What are the advantages of MacRuby over Objective-C?
What are the advantage of O-C over Ruby?
Is Xcode's support for O-C significantly better than it's handling of Ruby? Do I care?
At this point I'm primarily interested in OS X development, but iOS clearly needs to run a close second. What's the current status of Ruby development for iOS and is it likely to go anywhere in the nearish future?
Any thoughts on the longer-term prospects of either language?
Any thoughts from anybody will be much appreciated.
Thanks, Bryan _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
participants (8)
-
Bryan Harrison
-
Jordan K. Hubbard
-
Laurent Sansonetti
-
Morgan Schweers
-
Rich Morin
-
Rob Gleeson
-
Scott Ribe
-
Terry Moore