1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Totally new to programming, need some help

Discussion in 'Mac Programming' started by whoisparker, Sep 10, 2008.

  1. macrumors newbie

    #1
    I'm a web designer and am looking to get into programming. I have zero experience with programming. I think the best place to start is with C (open to suggestions) and last night purchased the K&R book on C. I almost exclusively use a Mac (OS X 10.4 - Tiger) and would like to learn my programming skills on it. The problem is I don't know where to start. I want to start with the classic "hello, world" program, but as I said, I have zero programming experience and am not sure what to do first. I don't know what application to write it in. I don't know how to compile it or what application to use or where to get one for my mac. The list goes on. Any insight would be greatly appreciated! I would also be interested in any resources for learning C or programming on Mac for a total novice like me. Thanks in advance, I look forward to your suggestions!
     
  2. Moderator

    robbieduncan

    Staff Member

    #2
    Go to developer.apple.com. Create a new (free) developer account or use your existing apple ID. Download the developer tools. This will give you a compiler and XCode to type in.
     
  3. macrumors 6502a

    #3
    it was my understanding that the latest sdk is the only one available and that it only runs on intel machines... you didn't specify your computer but if you're running tiger.......
     
  4. macrumors 68040

    lee1210

    #4
    I normally parrot the same thing in all of these threads, so I'll try to break that habit and link to some existing threads on this subject:
    http://forums.macrumors.com/showthread.php?t=409568
    http://forums.macrumors.com/showthread.php?t=529942
    http://forums.macrumors.com/showthread.php?t=521631
    http://forums.macrumors.com/showthread.php?t=509900
    http://forums.macrumors.com/showthread.php?t=455936
    http://forums.macrumors.com/showthread.php?t=481125
    http://forums.macrumors.com/showthread.php?t=471251

    There are others, as many people have come here with the same questions. Unfortunately there's no an absolute answer to this. The major disagreement between those of us that respond is whether you should use XCode starting out or just a text editor and the commandline to compile and run. You'll learn either way, i think the later is more straight-forward.

    Good luck!

    -Lee
     
  5. Moderator

    robbieduncan

    Staff Member

    #5
    The iPhone SDK is only available on Intel, that is true, but for Mac programming (and C in general) you are OK. From the About XCode 3.1 PDF (here)

    "Xcode 3.1 is compatible with Intel and PowerPC Macs running Mac OS X 10.5 Leopard. Xcode 3.1 supports development targeting Mac OS X v10.3 Panther and Universal applications for Mac OS X v10.4 Tiger and Mac OS X v10.5 Leopard using the Mac OS X SDK support."
     
  6. macrumors 68040

    plinden

    #6
    I'm on the start out with a text editor and command line side, especially if you're starting from a generic C book like Kernighan and Ritchie. Either way, you'll need the developer tools to get gcc (the c compiler).

    For editing, I suggest you download the free TextWrangler (it has context sensitive formatting).

    I use vi when I'm using the command line, but I learned that when the only other other options were ed or emacs - the muscle memory after years of vi means I'm quite fast with it.
     
  7. macrumors newbie

    #7
    Thank you everyone for your insights so far.

    I think I would like to start out with a text editor and command line rather than using something more automated at first.

    I know I'm being a total n00b but I am really confused as to how to get fully started. At work I have access to OS X 10.5 so I created an Apple Developer account and downloaded Xcode. I went to Developer/usr/bin/ and found an alias for gcc there. But I can't open it. Am I missing a step?

    And I also already downloaded TextWrangler, but I'm just not sure how to access the command line tools. I wish there were a good resource for how to get started learning these things on a Mac...
     
  8. Moderator

    robbieduncan

    Staff Member

    #8
    What do you mean by open it? You can't double click on it! It's a command line tool to use from the Terminal.
     
  9. macrumors newbie

    #9
    ok, so this is all totally new to me. How would I go about using Terminal? For example, could I type my "hello, world" code in it? Then where will the results show up? Also in Terminal?
     
  10. macrumors 603

    notjustjay

    #10
    Yes.

    If the concept of Terminal is new to you (it's a bit of a throwback to a few decades ago :) ) then your first step should be to familiarize yourself with it. Get comfortable with how to browse around your hard drive, how to create new text files, rename them, delete them, and so on.

    Then you can use a simple text editor to write your first "hello world" program, use terminal commands to compile it, and run it, and see the output printed in the Terminal window.

    Start there, and learn how to do fancier programs. Be comfortable writing stuff and running it in Terminal, THEN make the jump to programs that use the OS X interface with windows and buttons once you're familiar with the basics.
     
  11. macrumors newbie

    #11
    Thanks! I found some good starting points on Google to play around with Terminal. I'm going to familiarize myself with it and get comfortable. If anyone else has any other insights for a total novice to start learning programing skills, I would greatly appreciate it!
     

Share This Page