Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

whoisparker

macrumors newbie
Original poster
Sep 10, 2008
4
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!
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
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.
 

liptonlover

macrumors 6502a
Mar 13, 2008
989
0
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.......
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
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:
https://forums.macrumors.com/threads/409568/
https://forums.macrumors.com/threads/529942/
https://forums.macrumors.com/threads/521631/
https://forums.macrumors.com/threads/509900/
https://forums.macrumors.com/threads/455936/
https://forums.macrumors.com/threads/481125/
https://forums.macrumors.com/threads/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
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
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.......

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."
 

plinden

macrumors 601
Apr 8, 2004
4,029
142
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.
 

whoisparker

macrumors newbie
Original poster
Sep 10, 2008
4
1
Thank you everyone for your insights so far.

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 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...
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
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?

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.
 

whoisparker

macrumors newbie
Original poster
Sep 10, 2008
4
1
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.

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?
 

notjustjay

macrumors 603
Sep 19, 2003
6,056
167
Canada, eh?
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?

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.
 

whoisparker

macrumors newbie
Original poster
Sep 10, 2008
4
1
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.

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!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.