Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > C++ on a Mac

C++ on a Mac
Thread Tools
TheoCryst
Mac Elite
Join Date: Nov 2005
Location: Seattle, WA, USA
Status: Offline
Reply With Quote
May 11, 2006, 06:26 PM
 
I'm a CS major, sophomore year. I've got some C and Java under my belt, but feel as though learning C++ would be a very good idea for the work force. On the Windows side, there's Visual Studio C++, etc. What do you all suggest for C++ coding on OS X? I'm on an iBook, so Boot Camp isn't an option.

Any ramblings are entirely my own, and do not represent those of my employers, coworkers, friends, or species
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
May 11, 2006, 06:35 PM
 
Xcode?
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
TheoCryst  (op)
Mac Elite
Join Date: Nov 2005
Location: Seattle, WA, USA
Status: Offline
Reply With Quote
May 11, 2006, 07:13 PM
 
How does Xcode stand up against Eclipse with the C/C++ Dev Kit installed? I'm definitely more familiar with Eclipse, and would like to stay there if possible.

Any ramblings are entirely my own, and do not represent those of my employers, coworkers, friends, or species
     
Mithras
Professional Poster
Join Date: Oct 1999
Location: :ИOITAↃO⅃
Status: Offline
Reply With Quote
May 11, 2006, 09:44 PM
 
Well, then install Eclipse!
     
itistoday
Professional Poster
Join Date: Oct 2001
Status: Offline
Reply With Quote
May 14, 2006, 04:06 AM
 
Dude, forget those ridiculously bloated IDEs, go with TextMate. Eclipse SUCKS on OS X. TextMate is seriously the best source code editor I know of. It's fast, light-weight, and is amazingly customizable while maintaining ease of use.

In short: TextMate + Makefiles + Terminal + GCC.
     
Dr.Michael
Registered User
Join Date: Oct 2003
Status: Offline
Reply With Quote
May 15, 2006, 12:24 PM
 
Originally Posted by itistoday
Dude, forget those ridiculously bloated IDEs, go with TextMate. Eclipse SUCKS on OS X. TextMate is seriously the best source code editor I know of. It's fast, light-weight, and is amazingly customizable while maintaining ease of use.

In short: TextMate + Makefiles + Terminal + GCC.
Although I don't code c++ I support this. I work like that with java. Only problem: How do you debug? These endless System.out.println() resp. printf() suck.

Eclipse without at least a 20 inch screen is not what you want to use.
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
May 15, 2006, 01:03 PM
 
OK, TextMate + Makefiles + Terminal + GCC + GDB.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
itistoday
Professional Poster
Join Date: Oct 2001
Status: Offline
Reply With Quote
May 15, 2006, 05:36 PM
 
Originally Posted by Dr.Michael
Only problem: How do you debug? These endless System.out.println() resp. printf() suck.
As Chuckit mentioned, I use GDB, along with, as you mentioned, print statements. In addition to those I make extensive use of exceptions, this allows me to track down problems that don't cause seg faults, while GDB handles the rest. But yeah, personally I find the printf method* very easy and very handy. A good night's sleep helps to prevent making mistakes in the first place as well.


* Regarding printf, as you're probably aware, in C it's better to use fprintf(stderr, "message") instead because that's flushed instantly, and thus no messages are lost due to a potential crash.
     
Dr.Michael
Registered User
Join Date: Oct 2003
Status: Offline
Reply With Quote
May 17, 2006, 04:59 PM
 
Originally Posted by itistoday
As Chuckit mentioned, I use GDB, along with, as you mentioned, print statements.
That would be jdb for java. Is it really ok to use a commandline debugger? How do you work with it?

Regarding printf, as you're probably aware, in C it's better to use fprintf(stderr, "message") instead because that's flushed instantly, and thus no messages are lost due to a potential crash.
No, I am not aware (any more). I wrote the last line of c code maybe 10 years ago on an eltec OS 9 lab computer. But I will go on bringing together java and c. Java for ease of use, rapid development and powerful guis, c for all performance critical things. But thank you for the tip. This is something that is rarely mentioned in textbooks.
     
Dr.Michael
Registered User
Join Date: Oct 2003
Status: Offline
Reply With Quote
May 17, 2006, 05:09 PM
 
Just a side note, since you have mentioned TextMate.

TextMate is now what BBedit was many years ago. It is astonishing. First users require functionality (all kind) and then they go for a minimalistic software that feels lightweight.

I guess we all look for exactly the solution that has all the functions we need, but not more. What does this mean for software development?

TextMate looks perfect for a programmer. Maybe thats the reason why I still prefer BBedit 5 over 8 (except for the functionality that shows multiple documents in one window).
     
itistoday
Professional Poster
Join Date: Oct 2001
Status: Offline
Reply With Quote
May 17, 2006, 05:26 PM
 
Originally Posted by Dr.Michael
That would be jdb for java. Is it really ok to use a commandline debugger? How do you work with it?
It's pretty simple, just do: jdb MyClass arguments. Then type 'run' or 'help'. Really, just read the man page on jdb by typing: man jdb
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
May 17, 2006, 05:35 PM
 
The Xcode debugging function is pretty much just a GUI for the command-line debugger.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Thinine
Mac Elite
Join Date: Jul 2002
Status: Offline
Reply With Quote
May 18, 2006, 04:50 AM
 
Yeah, you can just use Xcode. TextMate is a better editor but Xcode is a far easier solution.
     
aadfadsfa33
Fresh-Faced Recruit
Join Date: Jun 2006
Status: Offline
Reply With Quote
Jun 2, 2006, 05:18 PM
 
I also like Aquamacs Emacs which is Emacs with a pretty, OS X interface.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 02:49 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,