Programming on a Mac...

Shakermaker

macrumors newbie
Original poster
Feb 8, 2002
4
0
Portugal
Hi, I'm a student from Portugal. I've been fascinated by the Mac platform for a while, but it's only know that I've put together enough money to buy a computer just for myself (it's hard earning money being a high-school student ;) ).

The thing is, that I intend to study Systems Engineering, and I wondered if the Mac was the right choice. As universities here are PC/Linux dominated, i was wondering...

Is it possible to program C, C++, Pascal, or any other mainstream computer language on the mac? If it is, can I take the code and compile it so it's viewable on PCs? Can I take the code and work normally with it on a PC? Which programs can I use?

Thanks in advance.
 

Durandal7

macrumors 68040
Feb 24, 2001
3,153
0
C and C++ are available on the mac as well as Pascal I believe. While it is C code at the core much of it must be changed in a (sometimes tedious) process called porting. Event triggers,system calls and frameworks on the mac are completly different from a PC. Your code will be viewable but not compilable on a PC. The only way to pull that off is to compile a UNIX application which would require less tinkering to work with Darwin. This is of course assuming that RealBasic isn't an option.
If you do program on the Mac I would recommend Codewarrior or OS X's own development tools.
Install VirtualPC if you want Windows compatibility.
 

balliet

macrumors member
Dec 21, 2001
68
0
If all you are doing is simple command line apps in C, C++, or Java, you should have no problems running them on OS X. You don't even need any extra software. OS X comes will all the development tools you'll need. A simple recompile is all it should take for 90% of the apps. If you get into X11/Qt/GTK+ or other GUI development, there is some other stuff you need to install (all free software), but its still doable on OS X.

Now Win32 programming is a completelly different story, but you said "PC/Linux", so I assume you're not doing any Win32.

Also if you want to write apps that use Aqua (OS X's GUI), you need to use either the Carbon or Cocoa APIs. Some Cocoa apps might work on Linux with GNUStep, but don't count on it.

asurace is right that there is a lot of stuff out there that does need porting, but assuming your code is simple as the stuff I'm writing for school now (I'm a first year IT student), you shouldn't have any problems.
 

Beej

macrumors 68020
Jan 6, 2002
2,139
0
Buffy's bedroom
I'm about to start the final year of my Computer Science degree. There has not been a single thing that I've needed to do that I couldn't do in Mac OS X.

Mac OS X is one of the best things that has ever happened to me... it's saved me soooooooo much trouble in this area.

So I say: go for it! Get a Mac!
 

agp

macrumors member
Jan 11, 2002
80
0
Software Engineering

I am in my 3rd year of my Software Engineering degree, and only recently a Mac convert(about 6-9months).

I have had absolutely no problem using a Mac to program on, and for the odd time you do need a PC you can run VPC or use University computers.

Most of the environments we have used for programming languages such as Prolog and Scheme in have equivalent environments on the mac (at least in OS 9).

Before I started my degree I almost bought an iMac, but bought a PC because I thought a mac wasn't sufficient for my needs.

For the two years leading up to my mac purchase my housemate had a mac and was on the same course. I could see that it was fine for everything and took the plunge since they are so nice (and I photoshop a lot!)

Hope I have persuaded you!

Adrian
 

Shakermaker

macrumors newbie
Original poster
Feb 8, 2002
4
0
Portugal
Thanks!

Here's the thing, when I wrote PC/Linux, I meant Windows/Linux, this is, both.

How is the porting process?? It sounds as if it's not too easy too do it...
 

Falleron

macrumors 68000
Nov 22, 2001
1,609
0
UK
Virtual PC is the way forward for you. It is an ideal place to run the same software as on your university systems + also have the advantages of the Mac.
 

Falleron

macrumors 68000
Nov 22, 2001
1,609
0
UK
Hmmm, I dont have any figures + I have never programmed using VPC but from my experience + what people have said in other threads a new mac will probably emulate a 600Mhz PC? Of course it depends on which OS you are running + how much RAM you have but it has always done what I have asked of it.

VPC is no substitute for a real PC but it does the job. There must be software for the mac to let people program (+ still be compatible with PC's)!!
 

afonso

macrumors member
Feb 5, 2002
85
0
San Francisco
Programming!! :)

Hey Shaker,

I did a whole 3 year course in Computer Science and I'm currently finishing a Masters degree in Computing as well.

I did every single coursework on the Mac, ranging from C, C++, Java, OpenGL, Assembler, whatever really.

There shouldn't be any problem for you, specially if you use OSX to do all the programming. The OSX development tools are EXCELLENT!!!

I am currently programming a Visual Prolog IDE for MacOS X, written entirely in Cocoa/Objective-C...

And by the way... tambem sou portugues... se tiveres algum problema vai dizendo q eu ajudo no q for preciso :)

Take care, boa sorte, and I'll see you around!
Afonso
 

agp

macrumors member
Jan 11, 2002
80
0
Linux

BTW, you can also install SUSE Linux on your mac if you need too.

So, you can have

1. Mac OS 9
2. Mac OS X
3. VPC running any windows or PC linux system
4. SUSE Linux.

What else do you need?
 

Choppaface

macrumors 65816
Jan 22, 2002
1,187
0
SFBA
the VPC representatives over at their board said that VPC will probably only emulate a 200mhz to 300mhz equivalent pentium even on the fastest sytems. maybe they've updated their figures, but at that time the dual 800 was the fastest system....
 

Taft

macrumors 65816
Jan 31, 2002
1,319
0
Chicago
So many programmers...

Its great to see so many CS majors using Macs!! I myself am a graduate in computer science and wish I would've had OS X when I was in school. It truely is a Unix/Mac programmers dream.

I hope all of you programmers keep hanging out here. :)

Matthew
 

evildead

macrumors 65816
Jun 18, 2001
1,275
0
WestCost, USA
Im a CS suddent too

I use the new OS X develper tools for everything. I do for school.... well.. almost. I have to code in Assembly for the x86 some times and in LISP. No mac assemblers or interpriters for those. :(

Apple give you developer tools with OS X do develope in JAVA and C++ plus many more...

You can get IDE's from Borland, CoadWarrior, And there is a new one for Fortran too.

All OS X friendlyn :)

When you absolutly have to use Windows (I did for Visual Basic) you can run Virtual PC 5.0. It does a pretty good job of emulation.