Objective-C or Ruby

Discussion in 'Mac Programming' started by thisday, Oct 29, 2008.

  1. thisday macrumors member

    Oct 29, 2008
    I want to learn a prog. language (i dont know programming) that will help me develop mac apps. There is a lot of fuzz about Ruby, how great how easy it is, and seen some examples i agree. Its easier than obj-c. With macruby comes much closer to mac platform.

    Obj-c is the language that apple uses natively and most apple developers to bring awsome apps.
    I dont mind much if eg ruby has difficulty 5 and obj-c 7 because i want to learn a powerful language.
    Also with ruby and the rails framework you can create web apps. You learn one and do both mac and web apps.

    But i still cant deside.
    Can someone , from expirience, tell me what finally desided between those two? I will miss something important about code, compability etc from obj-c if i learn and write ruby?

    Also suggestions are welcome.
    Thanks in advance for any help.
  2. garethlewis2 macrumors 6502

    Dec 6, 2006
    If you already know C, Objective-C is learning level 1.

    Objective-C isn't difficult at all. What is difficult is learning all the frameworks that you will use.

    Rails programming is very different to normal Ruby programming. The Web Apps that are built using Rails are pretty limited. Reporting is not available by default, and as long as you want to build a blogging site or very simple Face book clone, it doesn't allow much scope.

    And Ruby would be level 11 in comparison to Objective-C. The language is huge, with functional, procedural and pure-OO mixed into a program.

    I code both, but would at the moment code in Objective-C and Cocoa, RubyCocoa, is still evolving.
  3. thisday thread starter macrumors member

    Oct 29, 2008
    Thanks a lot. This made things more clear.
    From tha beginning i decided to learn, Objective-c and Cocoa feels right to me for an unknow reason. I guess i was pretty much to the right path. I dont code at all but i ll have to study c for uni after february.

    "And Ruby would be level 11 in comparison to Objective-C." by this u mean its more difficult comparing to the 7 i told in my post? Thats good news to me. But everyone is thrilled how easy ruby is and showing off the hello world comparing example.

    "The language is huge, with functional, procedural and pure-OO mixed into a program." This goes to ruby i guess. I made a little search at wiki to understand the terms and i dont like much the all together thing. Am i right?
  4. toddburch macrumors 6502a

    Dec 4, 2006
    Katy, Texas
    I know Ruby very well (and C, C++, Java, and ASM), but have not dabbled much in Obj-C passed a few tutorials.

    Several years ago I tried to learn Java and OOP at the same time, but failed miserably. But, when I got into Ruby in 2004, all the OO stuff just made sense with Ruby much more so than it did in Java. (Java was much easier to pick up after I had all the OO stuff down from my Ruby experience).

    Anyway, I'll tell you why I like Ruby. Even though one can code in Ruby to be very cryptic and hard to read, it can also be coded out to make perfect sense and easy to follow, and you don't have to use all the esoteric stuff to get the job done. Like the other poster said, you can code in Ruby to be procedural if you want. I like the iteration and containers with Ruby. The naming convention for constants, class and method names, local variables, instance variables and class variables really makes sense to me. There are a lot of web resources and bookstore books available for Ruby.

    So, my intention is not to shove Ruby down your throat - I just wanted to say it's a worthwhile language to learn and cut your teeth on. (I try to ignore the Rails stuff, personally.)
  5. kerthi macrumors newbie

    Feb 1, 2008
    I think what should be made clear is that both languages serve entirely different purposes.

    If you want to code desktop applications on a high abstraction layer (which usually is faster in terms of coding time, but not really flexible) use Ruby. If you want to get the cool low level stuff, use Objective-C. Objective-C is faster too, because it's not interpreted at runtime.
    If you want to develop for the Web use Ruby. That's what it is famous for. A lot of modern web frameworks use Ruby as their base, beside Rails also sproutcore and several others. For this reason everything you will ever need regarding webapps is already there.

    cheers kerthi
  6. thisday thread starter macrumors member

    Oct 29, 2008
    A ton of books out there.. pragpro is rubyheaven. Almost tempting.
    The cool low level stuff sound cool:cool:
    I m more for mac and iphone apps.

    Everything has its pros and cons. I guess making the code simpler doesnt mean better.
  7. Catfish_Man macrumors 68030


    Sep 13, 2001
    Portland, OR
    Yes it does. Simpler is only worse if the tradeoffs involved in making it simpler outweigh the benefits.

    Personally, I think macruby looks very appealing, but it's a very young project. Not completely finished, not much documentation or sample code, not much expertise out in the world (so few people to ask questions to).

    I suspect that once it matures I may end up using mixed macruby and objective-c for projects I work on.
  8. thisday thread starter macrumors member

    Oct 29, 2008
    From this point of view i meant it.
    But since no here tells me that there are missing pieces and tradeoffs, and the only con is the age of the ruby project, i ll go for obj-c and later get some ruby.
  9. Catfish_Man macrumors 68030


    Sep 13, 2001
    Portland, OR
    Sounds like a good plan to me. Also insulates you if Apple backpedals on the bridge support stuff as they did with Java.
  10. thisday thread starter macrumors member

    Oct 29, 2008

Share This Page