Programming with a Mac

I enrolled in an online C course this semester and by chance one of my friends a hundred miles away enrolled in the same one, except almost two weeks into the course because of some difficulties with the bureaucracy. Now it is too late to switch classes, which would be the best idea because this is a 2000 level course and she’s never programmed, but since it is still pretty basic stuff I’m trying to give her a quick start.

Here’s the problem, I don’t know crap about Macs and she has one with OSX. I had her download Xcode but I don’t know how to tell her to use it. I know there are some Mac programmers out here so I thought I’d run it by for a quick answer. I’m having a really hard time finding any instructions online that aren’t for using console commands, and it’s really be best if she could use a GUI.

If you were programming console apps in C, how would you describe the process?

gcc is very easy to use for simple things. gcc codeFile.c -o outputfilename should do all you need (or g++) for basic programs.
It’s worth trying to get her to understand that as early as possible, imo.

How do you access the OSX console to give text commands, and how do you refer to file locations?

OSX console is called Terminal (like DOS Box on windows). If she has a default install its in the utilities folder of applications (I have mine in the Dock because I use it enough).

Files are accessed via:

/users/ZZZ/Documents (or applications or whatever)/JJJ/KKK/…so forth where:

ZZZ is the name of the user. If she went for the default, and her name is Jane Doe then it might be:


JJJ and KKK are just filenames (replace them with whatever you want).

Terminal accepts bash commands (because it is a bash shell) like cd, gcc (if you have it installed).

For XCode, it should be relatively easy to figure out (at least the basics). I haven’t had a lot of time to go in depth, but its supposed to be extremely powerful. Like most IDEs you can compile straight out of it.

Thanks guys, this is kinda difficult to teach to her because she’s never ever programmed before and I don’t know how computer savvy she is, we were just in a club back in freshman year. I appreciate your info.

The programs I did at uni in C were done with the command-line (terminal as mentioned). It makes handing in assignments easier because you know exactly which files to hand over and it’s easy for the tutor to compile it no matter what system they use.

Normally, beginner programs will have only a handful of c files. She shouldn’t worry about starting 2nd year courses without programming, I did that and it worked out ok.

Xcode can handle console apps too though, you just choose the right project template. If she goes to the file menu > new project > command line utility -> standard tool, this makes a C-based console app.

I can’t say that I like Xcode that much, I find it a bit slow and it has all sorts of weird junk like zero-link building or something that gets a bit confusing. Xcode 3 that comes with Leopard (out in October) should be better performance-wise and has much better debugging tools but I’d suggest sticking with the terminal - the classes should teach about gcc command options anyway.

I’d say that for GUI apps, definitely move to an IDE because interface programming is just so pointless when drag and drop can be done in a fraction of the time with the interface building tools Apple gives you but that likely won’t come up until 3rd year courses.

We’re using all Windows apps because of the MSDNAA contract the school has. This is why I have to help her out, there are no course instructions for using a Mac, the class is almost entirely using Visual Studio or its derivatives.

Pretty lame, if you ask me, but this course is from a community college. When I took CS courses from Oklahoma State we used Unix via telnet.

With MSDNAA you should be able to get Windows XP/Vista along with the Visual Studio Suites. That combined with Boot Camp (assuming she has an intel mac) would allow her to dual boot Mac OS X and Windows XP (assuming she has enough HD space).

She could always get parallels or another emulator, but I’m not sure how well programming would run on them.

As long as that C class dosn’t starting pulling cheap stuff like “WinMain” or “[B][I]__declspec[/I][/B]” on her she should be fine with a mac.

I learned C on a Dec VAX mainframe at my college - everyone hated that machine.

Actually, that school is doing you a very great service by introducing you to the fact that, "in the real world, there is more to life than ‘just Windows.’ "

Macintosh OS/X is based upon a by-now-ancient lineage of computing … dating “all the way back to the very-dark-ages of” :rolleyes: :rolleyes: circa 1971… (ahem!) … called Unix, from which the (very recent!!) Linux system is also based.

Although “the Unix way of doing things” might superficially appear to be stupendously different from “the Windows way of doing ‘the same damm thing’ …” :slight_smile:

… the real lesson to be discovered here is that: it is ‘the same damm thing!’ :smiley:

Throughout your fledgling career in the world of computers, you will discover that … (at the present “state of the art” at least… be warned! …) … although you seem to be constantly faced with a world that is ‘stupendously different,’ you are actually faced with a world that is ‘stupendously the-same.’ Windows and Linux and OS/X are, believe or not, accomplishing more-or-less the same purposes in more-or-less the same way.

… All of which might somehow help to prepare you for the “brave new world” that will one-day surely confront you, just as surely as it once (or now…) confront(s)(ed) your fathers and your mothers: a world that is ‘stupendously different,’ :eek: thanks to the ever-advancing world of high technology.

You live “in interesting times.” Like it or not.

It’s hard for me to see which side of sarcasm you’re aiming for, but actually, they’re not. They’re only supporting Windows. I thought that was obvious.

The University that I’m eventually getting my degree from uses and supports both Unix and Windows (note: computer science courses only). There are Macs and PCs in their computer labs.

The community college I’m taking budget priced classes at right now only explains how to get started in the Windows only programs and their labs are all PC, so my less-than-computer-savvy friend with a mac book is SOL without friends to help her out, or in this case, ask other people to help her out. :wink: