views:

463

answers:

9

I am a first year Comp. Sci. student and am looking for the best way to develop C++ on a Mac. I have Xcode and Textmate.

What are the benefits/negatives of each? Are there any better ones?

I am not a fan of having to use a whole project to run programs with Xcode. Is this the only way to do it, or am I mistaken?

Also, is there a way to change the default text that is included in a .cpp file in xcode?

+4  A: 

I'm a huge fan of textmate. It gives you a lot of power but doesn't get in your way. You could also try Eclipse for C/C++

Gren
+1  A: 

Netbeans is free, has great auto-completion for C++, Java and others. It's also cross-platform.

http://www.netbeans.org/downloads/

Carlos Rene Perez
+4  A: 

With Xcode you can edit each file separately, without needing them to belong to a project. Also, you can look in /Developer/Library/Xcode/File Templates for the templates used by Xcode; feel free to take a whack at them as you find suitable.

Williham Totland
+11  A: 

What is a good way to edit C++ on Mac OS X?

With your head.

Try both. Text editors are a matter of personal taste. See the flames over vim vs. emacs that make the Sun look pale.

The only one that can tell you what is the best text editor for you, is you.

voyager
+4  A: 

http://code.google.com/p/macvim/

I would dig in and learn vim (or emacs if you really want to).

EDIT: You've got 4+ years ahead of you in CS. I really would suggest learning vim or emacs especially when you are still in university.

Max
+1  A: 

I am not a fan of having to use a whole project to run programs with Xcode. Is this the only way to do it, or am I mistaken?

Because MacOS X is built on top of Unix you have many development tools available to you that lie outside of XCode. Most notably with a good Terminal application you can develop directly with gcc, bypassing XCode altogether. In that case I'd recommend finding a source editor you're comfortable with, such as TextMate or one of the others recommended here. Using gcc directly gives you the rapid turnaround with little overhead you seem to be looking for.

fbrereto
+1  A: 

I'm a huge fan of emacs, because:

1) It's extensible. Thousands of languages are supported, you have modes for editing XML, HTML, etc. 2) It's highly configurable. You can set your own key bindings, change indentation, etc. 3) It's powerful. It integrates easily with compilers, debuggers, it makes text editing really quick.

You can check vi, textmate or xcode too. They're all great editors. It all comes to which one works better for you.

diogoriba
A: 

I quite like Xcode. I'm not sure why you ruled it out. It's really not that complicated.

nbolton
+2  A: 

I almost exclusively use Textmate, but to be fair the decision to switch to Textmate (coming from codewarrior in OS 9 days), was mainly because the XCode editor (then named ProjectBuilder) was annoyingly slow at editing larger files.

I'm sure that changed a lot over the years, but I see no reason to switch so I don't.

That said, one thing where XCode really outshines Textmate is the integration of a debugger, when you're just starting to learn, I think having an integrated debugger will help you quickly understand what's going on with your code, and will be a great advantage...

If you've got Textmate, just try em both for a few months, you're a student anyway, you should have plenty of time

Pieter
One thing to think about is that you do have the opportunity to dig in and learn more than usual since you are in school. If you don't have much programming experience, I would go the xcode route, but it would ultimately suit you better to learn how to use gdb using a text editor from the command line. Do yourself a favor and don't limit yourself to an IDE for the rest of your life.
Max