Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
No need to use FreeBSD as Mac OS X is basically the same with a different GUI on top. Just learn to use the Terminal application in Mac OS X and you should be fine.
So can I actually use a UNIX book in order to learn how to use the Terminal?
 
So can I actually use a UNIX book in order to learn how to use the Terminal?

Yes. Apple's Terminal.app uses Bash, which is one of the most popular Unix shells. OS X is a BSD derivative, just like FreeBSD, and Leopard comes with X11. Just about any program that works on various Unix implementations (including the desktop environments) will compile and run on OS X and everything in that UNIX book should work without a problem.
 
Hmm... I guess this is also why a compiled *.cpp file is seen as a "Unix Executable File" by the OS.
 
Well... hi, guys! I'm back.

Unfortunately, I'm not satisfied with what Xcode has to offer. I mean... it looks like a great development tool for large applications, but I'd like something simpler, as everything I do for now resumes to running the code in the textbook I'm currently following, and solving the exercises at the end of the section. For this job, Xcode seem rather annoying, and full of useless stuff.

For example, the code window is already small. I don't need Xcode to add all the Copyright stuff at the beginning of the program. And I can't keep on deleting it each time I create a new file.

Also, each time I add a new file, I'm required to deselect the previous one as being the target file. And this is rather annoying, getting you out of the mood.

What I'd like you to do is tell me other IDEs you know, and I'll check each of them. I've also heard some stuff about vim. I'll look into it, but I'd still like you to tell me about other IDEs. Or at least, tell me about how I can organize the application better.

Thanks in advance!
 
What I'd like you to do is tell me other IDEs you know, and I'll check each of them. I've also heard some stuff about vim.

I always try to keep everything as simple as possible.

If all you're doing is basic command line only programming exercises from a beginner programming book, then I recommend that you just use basic text editors and compile stuff on the command line (I always do that, no matter how complicated my program is, because I don't like using IDEs but that's for another thread). Pick a text editor and use that. I personally prefer vim but it takes a long time to really get the hang of it. emacs is another popular and very powerful editor. If you want something extremely simple, then use nano. All of these should already be installed on your Mac and can be executed from within Terminal.

For compiling your code, learn how to use the command line compiler for whatever language you are using (e.g. use g++ for programming in c++).

If you're stuff is getting too cumbersome to always type out on the command line, when compiling, then learn to use a build system (I use cmake + makefiles) or then start using an IDE.

If you need to debug your code, start learning how to use the GNU GDB debugger.

This way, you will develop a solid foundation and know what is going on 'under the hood' when you use an IDE.
 
I've downloaded Emacs, and I can't seem to find my way around it. So now I'm downloading Vim from Google Code, VERY SLOWLY. I'm optimistic about it because I've also found some kind of *.PDF book which will most probably help me a lot.
 
For Vim, just go into the Terminal.app and type in 'vimtutor'. That'll help you get through all of the basic commands. There's some more advanced stuff than what's in there (and are real timesavers, too), but you'll be up and running with what it does have.

To reiterate what others have said, don't bother with Xcode for the simple things you're doing now. Generally, if you're just doing a CLI program, you won't care about all the project management. Plus, it's always good to know how the stuff works in the background. Try making your own Makefiles, modularize your programs, etc.
 
Vim and Emacs come along with Mac OS X. No need to install them separately.
Yes, I've just figured that out. What I was downloading turned out to be the graphical interfaces, which I pretty much get to hate, now that I discovered vim. I simply love it, and the tutorial I'm following is so awesomely written, I haven't read something so good in a while.

For Vim, just go into the Terminal.app and type in 'vimtutor'. That'll help you get through all of the basic commands. There's some more advanced stuff than what's in there (and are real timesavers, too), but you'll be up and running with what it does have.

To reiterate what others have said, don't bother with Xcode for the simple things you're doing now. Generally, if you're just doing a CLI program, you won't care about all the project management. Plus, it's always good to know how the stuff works in the background. Try making your own Makefiles, modularize your programs, etc.
After I finish reading the 89-pages *.PDF, I'll try playing with it more by myself, and I'll also have a look over 'vimtutor'. I've already discovered the syntax highlighting by myself and it feels awesome :)

I'll also have a brief look over the terminal commands I need in order to compile my programs. I've read some things about makefiles, but I'm still not into them. I'll have to dig further.

Thanks a lot!
 
As I recall, the default .vimrc OS X comes with is pretty sparse. If you want, I can post mine, which does code highlighting for all the common languages.
 
Nevermind, I've got this solved. I will try working the rest of the book *quietly*, and if any more problems occur, I'll be a bother once again around here :)
 
What is your opinion on Panic's CODA

As a young professional web developer who is also learning C, I love using Coda for my work all day and study at night.

At work, I "Command-1" into my sites all day, and when I come home I "Command-5" into the Terminal interface, connect to the Local shell and easily compile my elementary C programs:

Code:
$ cc myProgram.c

I can see all my files on the left file source list and drag them into the command line if I'm too lazy to write out
Code:
~/Projects/C/a.out
or what have you.

I subscribe to Al3x Payne's theory that you should use as little software as possible. Although I want to make it to Xcode eventually, for learning and compiling C it is overkill.
 
You're probably aware of this, jayrobinson, but:

You can specify a name for the output executable with gcc.
Code:
gcc -o myproj myproj.c

You can even simplify it further. For really simple programs (that is, those with only one source file), you can use make without a makefile.
Code:
make myproj

Both will produce the same named executable. If you have multiple sources, though, you have to use a Makefile.
 
You're probably aware of this, jayrobinson, but:

You can specify a name for the output executable with gcc.
Code:
gcc -o myproj myproj.c

You can even simplify it further. For really simple programs (that is, those with only one source file), you can use make without a makefile.
Code:
make myproj

Both will produce the same named executable. If you have multiple sources, though, you have to use a Makefile.
I'm actually using g++ MYPROJ.CPP -O MYPROJ when I'm compiling my C++ programs (I'm sorry about not code-ing). Is it a syntax difference, or am I doing it in a wrong manner (I'm talking about you writing -o first, not the gcc/g++ commands).
 
'make' will also handle .cpp files (it'll do the equivalent of g++), FYI.

There's no difference in where you place the -o option; it's purely choice.

Code:
g++ myproj.cpp -o myproj
g++ -o myproj myproj.cpp
make myproj

They all do the same thing. I like using make, as it's simpler, less typing, and you don't have to remember to use gcc or g++ if you switch between C and C++ a lot.

(Note that it's not 'make myproj.cpp', as that'll fail.)
 
I didn't know at first anything about XCode, and being something delivered by the OS manufacturer, I assumed it's a bad tool with lots of flaws and limitations (see iWeb)...

Not XCode. It's a very useful piece of software. And using Cocoa with it is very easy.
 
I much prefer doing any kind of development on a Mac. Its Unix based, so for me it replicates a development environment a lot better than a windows box.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.