New to Programming

Discussion in 'Mac Programming' started by swimanole, Nov 2, 2012.

  1. macrumors newbie

    Joined:
    Aug 12, 2012
    Location:
    NC
    #1
    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!
     
  2. macrumors regular

    Joined:
    Mar 9, 2012
    #2
    what wrong with java on a mac?

    anyway if you need windows, you could always install windows on your mac
     
  3. macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #3
    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
     
  4. thread starter macrumors newbie

    Joined:
    Aug 12, 2012
    Location:
    NC
    #4
    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?
     
  5. macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #5
    If you install XCode, the commandline tools should come with it. You can run gcc directly through the terminal.

    -Lee
     
  6. thread starter macrumors newbie

    Joined:
    Aug 12, 2012
    Location:
    NC
    #6
    Thank you!
     
  7. macrumors regular

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

    Joined:
    Jun 11, 2011
    Location:
    Chicago
    #8
    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.
     
  9. macrumors 6502a

    macuser1232

    Joined:
    Jan 20, 2012
    #9
    I have the same exact computer as you and I love programming on my Mac! It's amazing! What's troubling you?
     
  10. 960design, Nov 6, 2012
    Last edited: Nov 6, 2012

    macrumors 65816

    Joined:
    Apr 17, 2012
    Location:
    Destin, FL
    #10
    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
     
  11. macrumors 603

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #11
    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.
     

Share This Page