Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

swimanole

macrumors newbie
Original poster
Aug 12, 2012
10
0
NC
I am a computer science major just getting started with trying to program. I am currently learning Java and C but I'm struggling with how to physically write the code using my 2011 13" MacBook Pro. I don't really want to buy a PC but a lot of people are recommending I do that. Can I get some advice? Sorry, I know this is really open-ended. Thank you!
 

zzLZHzz

macrumors 6502
Mar 9, 2012
277
71
what wrong with java on a mac?

anyway if you need windows, you could always install windows on your mac
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
A few things:
If you HAD to run windows or linux, you could do it on your Mac. You could boot these natively on your Mac or run them in a virtualization program.

There's NO reason you can't program C or Java on your Mac. The only way that you'd have a problem is if there is a binary library you needed to use that was only available for another platform, but that is highly unlikely.

So now you need tools. What tools are your classmates using in Windows or Linux that you don't have available on OS X? Eclipse is the most common Java development environment and is available on all 3 platforms. The most popular C compilers are gcc, and now llvm is gaining some traction. These are available on any of these platforms. If you need an IDE for C, XCode can handle that for you without issue (I think Eclipse can to given the right components, plugins, what-have-you). So what do you *need* that's not available? What have you been told to use that you don't have a replacement for?

In short: OS X is a great development platform. It is a very "desktop-friendly" Unix with broad support for tons of languages.

-Lee
 

swimanole

macrumors newbie
Original poster
Aug 12, 2012
10
0
NC
I recently downloaded eclipse for Java and I am adapting to it. We use a gcc compiler for C. I am not at all familiar with Xcode and everywhere I look to find out how to use it seems to be more confusing. Is there any way to use a gcc compiler without Xcode? If not, where is the best place to understand programming using Xcode?
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
If you install XCode, the commandline tools should come with it. You can run gcc directly through the terminal.

-Lee
 

Jodles

macrumors regular
Dec 5, 2008
172
3
I echo all of the above... Learn to love the terminal and pick up vim (my personal fav) or emacs.
 

itsmrjon

macrumors regular
Jun 11, 2011
122
0
Chicago
I am a computer science major just getting started with trying to program. I am currently learning Java and C but I'm struggling with how to physically write the code using my 2011 13" MacBook Pro. I don't really want to buy a PC but a lot of people are recommending I do that. Can I get some advice? Sorry, I know this is really open-ended. Thank you!

Physically writing code:
Most of us rely on vim, nano, or emacs. Some people use Eclipse, many of the rest use TextMate. I personally like TextMate for large local projects (I typically work on clusters, so then I rely on vim).

Buying a PC: Our entire lab (computational research lab) recently switched to Mac because it was EASIER for the quantity of programming we do. Single UNIX like operating system that allows us to even open the occasional garbage .PPTX or .DOCX files people send (god I wish business learned TeX).

Get all your compilers from the XCode CLI tools, and work in a unix like environment from there. Most IDE's will only slow you down when you learn to truly unleash the power of vim or textmate.
 

macuser1232

macrumors 6502a
Jan 20, 2012
668
4
I have the same exact computer as you and I love programming on my Mac! It's amazing! What's troubling you?
 

960design

macrumors 68040
Apr 17, 2012
3,700
1,569
Destin, FL
I am currently learning Java and C but I'm struggling with how to physically write the code using my 2011 13" MacBook Pro.
I use a macbook pro 2012 15" (non retina) and an iMac 2012 21.5" ( actually 2 of them ) at work.

I use Eclipse to write Java today. I started with Forte and Java back in the day ( 1994 or 1995?), but industry standards slowly erroded my determination to love Netbeans ( which I still have a huge fondness for ).
I use XCode to write C ( actually objective C but who's nitpicking ).

Learning to write a programming language is just as hard as learning a new language. How long would it take you to learn Japanese or Russian? The more you are surrounded by people that speak the language the faster you pick up on it. Same goes with programming languages. The cool thing is that once you learn one, Java for example, you can use alot of that knowledge towards different languages such as C/C++ or C# or even PHP.

Google for some tutorials in how to use eclipse and it will quickly become one of your favorite tools. A quick search yielded this: http://eclipsetutorial.sourceforge.net/totalbeginner.html ( I don't have time to look through the tutorial to see if it can help, but thought it may get you in the right direction. ) Out of time, compile is done. :)

just trying to help
 
Last edited:

firewood

macrumors G3
Jul 29, 2003
8,108
1,345
Silicon Valley
If you install XCode, the commandline tools should come with it. You can run gcc directly through the terminal.

The command-line tools don't come with Xcode 4.x. They are an extra download from Apple that Xcode can do using Preferences/Downloads/Components.

gcc is no longer included with Xcode. Instead, the C compiler commands are all aliases to llvm/clang. However you can use Xcode to build versions of gcc if you really need it.

A CS student who can't figure out how to manage the differences between using command-line tools on a Windows PC and command-line tools on a Mac isn't going to get very far.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.