Where to start...

Discussion in 'Mac Programming' started by Garrett, May 30, 2007.

  1. Garrett macrumors regular

    Apr 4, 2007
    I feel so lost, searching up and down Google and here.

    Do any of you recommend starting with one language for the Mac? Is there a guideline when you develop for Mac's? Any resources or tools I can use?

    Thanks a bunch:apple:
  2. CaptainZap macrumors regular

    Jan 17, 2007
    Hey Garrett,

    I recommend you start with Objective-C, there is a great introduction by Stephen Kochan that can be found here, Programming in Objective-C
    It will teach you the basics and more of Objc. Next to further develop apps for Mac OS X, I would recommend Cocoa Programming for Mac OS X it teaches you about Cocoa and some of the frameworks. They are both pretty good and you will also see that other people here recommend them as well.

    If you have any other questions feel free to PM me,
  3. ham_man macrumors 68020


    Jan 21, 2005
    If I were you, and were just starting out programming, I wouldn't jump into Obj-C right away. I would suggest starting out my writing simple command line apps in Ruby or C (which are both incredibly powerful in their own right). You gotta walk before you can run... :)
  4. hawaiian macrumors member


    I tend to agree that Objective-C is probably not the first language to jump into right away if this is your first language. I would go with Java since you won't have to worry about memory management, it'll work across platforms, and you'll get used to seeing a "C/C++ like syntax and grammar." If this is not your first language, and you're comfortable with Object Oriented Programming, memory management, etc, then go for C/C++/Objective-C. And if you're already familiar with programming and such, then you should choose the language based on what the needs of your program and users are.

    As for resources and tools that may depend upon the language and the breadth of your program and there are a ton! A mac comes with a bunch of tools standard to the Unix library. Emacs is generally my text editor of choice when it comes to programming, and it's included on your mac. It takes a while to get used to, but once you are, it can make programming quite fast. Keep in mind that it is an old program so it's not very graphically oriented. You'll have to install the X-11 Windowing System in order to get emacs outside the console. If you have X-11 installed, then you should be able to do this from the prompt:

    > emacs &

    The '&' forces the program to run in the background. If you want color, you'll have to do:

    M-x global-font-lock-mode

    from inside emacs. I think 'M' is actually the escape key on a mac. On other computers it may be 'Alt.'

    The other major tool to use when programming is the API. Java has an incredibly great documentation for their API online. http://java.sun.com/api should get you there. If you decide on C, then use the 'man' command at the prompt to get information on the function or set of functions that you wish to use. For example:

    > man strcmp

    should get you information on strcmp and other functions located in the same header file. You can also man the use of programs that are used at the prompt such as 'emacs' or even 'man' so give it a try!

    > man emacs
    > man man

    Sorry if this was no help, but hopefully it's enough to get you started. I used to be a computer science TA at the University of Washington (and probably will be for another quarter when I go back next year to finish up for graduation) so I know that getting started is probably the hardest part.
  5. janey macrumors 603


    Dec 20, 2002
    sunny los angeles
    this is changing with objc 2.0 (finally :D )

    ohh I hate emacs. not wanting to start a flame war though...

    My personal favorite editor is TextMate - http://www.macromates.com - it's not free, but it is one damn sweet app.
  6. mags631 Guest

    Mar 6, 2007
    Unless you have a specific goal in mind, just start with one of them and invest enough time to be very comfortable with it before branching out. Knowing a language is a lot easier than knowing how to program well. I learned non-OOP languages before jumping into OOP, but I don't think that really is a best practice that should be imitated (just a reality of when I studied CS in school). You'll find that once you learn one language, picking up the next is a lot easier so you are not wasting your time by not choosing "the right one" from the get go.

    There is a tremendous amount of resources on C, C++, and Java--pick one of those and go with it. However, if you are looking to quickly build simple Mac apps, then you may as well just do Objective-C and use the Apple provided tutorials as your starting point.

    Getting Started with Cocoa (Apple)

    The Java(tm) Tutorials (Sun)

    If you tell us a little bit more about your goal for programming, then perhaps we can give you a more specific answer.

    Finally, I recommend using XCode from Apple (it's free!) as your starting editor -- if you pick a non-traditional language, you may have to configure XCode to explicitly handle the language. However, if you start with C, C++ or Objective-C you are pretty much good to go!
  7. kiang macrumors regular


    Apr 8, 2007
    imo Java is a great language to start programming.
  8. Garrett thread starter macrumors regular

    Apr 4, 2007
    Thanks for all the responses, I know PHP so I believe PHP has somewhat of a advantage for me. So I picked up the books, and love it! I was able to make a fairly large program in about 2 weeks, I can post it up here if you guys would like.

    You drag an album inside a dropzone, and it will get it's cover and all of it's info. You can play the album and so forth, I am just so thrown off by how many frameworks their are!
  9. Nutter macrumors 6502

    Mar 31, 2005
    London, England
    I see no reason why you shouldn't start with Objective-C. I second the recommendation of the Steve Kochan book, it's very thorough and it doesn't assume any prior knowledge of C.
  10. HiRez macrumors 603


    Jan 6, 2004
    Western US
    As much as I like Obj-C and Cocoa, I would also recommend Java to start. In addition to the reasons given above:

    -- You can make both command line tools and GUI tools with Java. Languages such as Python and Ruby are wonderful, but getting to the GUI part can be complicated, and for me at least, GUI programming makes it more fun and makes it seem more like I'm doing "real" programming at the beginning. Staying interested long enough to continue programming is a major key.

    -- There is a HUGE amount of information available for Java: books, forums, tutorials, code samples -- and much of it freely available online. There's a decent amount of Obj-C/Cocoa resources available nowadays, but it still doesn't compare to Java. If you can use a Google/Yahoo! search bar, you'll never be stuck.

    -- Very very large amount of libraries and APIs written for Java. So if you want to do something such as control a device via serial interface, it's there. Yes, there are ways of doing this natively on a Mac, but not without going outside of that chosen language.

    -- There is really no server-side web coding API on the Mac for Objective-C/Cocoa if you want to write web applications (I am using Python and Django for this right now and loving it).

    Now having said that, I far prefer programming in Objective-C and Cocoa than Java. :) Going back would be rather painful, to tell you the truth. But, Java is useful and moving from Java to Objective-C is not hard at all.

Share This Page