Cocoa and C++ and Java?

Discussion in 'Mac Programming' started by Buschmaster, Oct 21, 2006.

  1. Buschmaster macrumors 65816


    Feb 12, 2006
    From what I've read cocoa takes advantage of C++, Objective-C, and Java, correct? So I'm looking at total beginning guides. Which should I learn? Would it hurt to learn C++ instead of starting with C and then going to C++? Also, I know a few languages alerady, so I will probably be able to get by with a bunch of online guides. I'm a college student so buying books would kind of suck...

    So if I have C++ and Java to learn, as I'm assuming from what I've read in books, what would you like to have learned first, or would it have not made a difference?
  2. Heath macrumors regular

    Aug 19, 2005
    Well, it depends what your end goal is.
    If you want to write native Mac applications, Objective C + Cocoa is the only way to go.
    If you want to learn C++ or Java there are two excellent (and completely free) books available at which address each language.
    As for recommendations on which order to go, or 'what to learn first', ask 10 different people and you'll get 10 different answers. Most of which however will mention 'C' at some point, so you may want to look into that.
  3. robbieduncan Moderator emeritus


    Jul 24, 2002
    There is a Java bridge to allow you to use Java to write Cocoa apps. This is basically discontinued and not recommended. There is no straight forward way to use C++ with Cocoa. If you want to use C++ then you are heading into Carbon territory.

    If you really want to use Cocoa Objective-C is the only realistic language to learn.
  4. Soulstorm macrumors 68000


    Feb 1, 2005
    My advice would be to learn plain C++ first. That would teach you basic and advanced OOP concepts. Then, Objective-C will be a two-days learning process for you. After that, you will be able to write mac-native Cocoa applications in no time. Objective C++ is a good way to go with Cocoa, too, after you have learnt C++. Learning C++ is crucial, imo because it will open you many doors into other platforms and programming enironments as well.
  5. davidjohnson macrumors newbie

    Oct 22, 2006
    Hi friends,
    c++ is a object oriented programming language,or it's c with classes,
    and java is also object-oriented programming language,it follows the syntax from c and oops concets from c++,
    my suggestion is u first learn c then c++ and java.
  6. Soulstorm macrumors 68000


    Feb 1, 2005
    C++ is far more than C with classes. It also has operator overloading, templates, and much more than just classes. C with classes is just the original name (and intention) of Stroustrup when building the initial version of C++. But many things have changed since then.
  7. BigMäc Guest

    If you want to use C++ and/or do cross platform development, Qt is a very nice option.
    Maybe it's a good idea not to learn C first. (link)
  8. Cvstos macrumors member

    Nov 19, 2004
    Personally, here's what I recommend.

    First, start with C++. It'll be tricky at first. Get a good book (or three) and go through it(them) completely. Once you're good at C++, you can start with Java or Objective-C. I've heard that Obj-C is easy to learn with C++ mastery, but I haven't gotten around to toying with it yet. That being said, 95% of Java truly is downright easy with C++ mastery or even just a good chunk of C++ experience. The only stumbling block is I/O, but once you're past that it's smooth sailing, really.
  9. HiRez macrumors 603


    Jan 6, 2004
    Western US
    Guys, don't we have, like, this exact conversation about...oh, once per week? :rolleyes: I feel like Bill Murray in Groundhog Day.
  10. caveman_uk Guest


    Feb 17, 2003
    Hitchin, Herts, UK
    Surely suggesting someone learn C++ in order to learn objective-C is bit of overkill? It's a bit like saying someone needs to become an electrical engineer just to change a plug.
  11. bousozoku Moderator emeritus

    Jun 25, 2002
    Gone but not forgotten.
    I'd think that learning Java first would be more useful since it's closer in philosophy to Objective-C than C++ is. Reading about Smalltalk helps a lot, too.

    Anyone who knows how to programme can pick up object-oriented languages but if you become too entranced by those extra C++ features, it makes it difficult to transition to another object-oriented language.

    davidjohnson and Soulstorm:

    I believe that C++ was called C + classes originally. Then again, there weren't compilers for it, just a pre-processor called Cfront.

Share This Page