简体   繁体   中英

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

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?

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 .

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.

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.

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

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

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

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

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.

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.

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

I recently used SublimeText it is nice and fast. Give it a try.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM