Jump to content

Newbie Programming Questions


AeroZeppelin
 Share

Recommended Posts

I've decided during my summer break to start learning how to program. I want to use my MBP to learn C/C++ (I know that most of you will disagree on the starting language and I may switch to Java.) However, Xcode is pretty daunting and I haven't figured out how to compile and work the program in my favor. Learning the code hasn't been the issue its trying to take tutorials and books written for either linux or windows and convert that knowledge to Mac. I've been googling for days on how to work xcode and compile. Can anyone suggest any sites or strategies on learning the program so I can start programming :)

What I have done:

read the Apple Developers site

Googled for tutorials

skimmed online manual.

P.S. I thought this question was too newbish for the likes of the programming coding sub-forum. Feel free to move it if i was wrong.

Link to comment
Share on other sites

I did some java programming on a mac at uni, it pissed me off muchly. That being said, it shouldn't be a showstopper.

I started learning using: ISBN-10: 0201711079 / Understanding Java / Barry Cornelius

I'm mostly writing Windows Services these days using Visual Studio in C# and that's what I find most enjoyable compared to all the other crap languages i've tried. VB can suck my fat one.

Back to the matter at hand. If you don't like Xcode, don't use it. You should be able to get by just fine without it.

Just Googled Xcode, looks like a total bag of shit. Defo work around it.

The best would probably be to download a nice, free text editor, like TextWrangler. Write your code in that and compile and run via Terminal...

Make a file with the code, name it file.c. Open Terminal use cd to get to the directory (folder) where the file is.

Compile with gcc -o program file.c

And run it with ./program

Of course you can use other names for your file and executable...

Link to comment
Share on other sites

What Operating System are you in/want to code for?

Windows:

If you're in Windows I'd say grab Dev C++ IDE here (uses GCC) >> Download Here

No install needed on that version, to compile just select Build > 'Compile' (you'll want the run the .exe from the command line)

Linux (my person favourite):

If you're in Ubuntu Linux you'll want the build essential pack, in your terminal type:

sudo apt-get install build-essential

To write code you can use gedit/any text editor, then to compile use these commands (in the terminal):

(you will need to be in the same dir as the saved source code (.c/.cpp)

g++ -Wall ./example.cpp

and to run it use:

./a.out

Never Coded in OSx.

If you have questions, or problems comiling/writing feel free to post them here or in the coding section of the forums :D

Link to comment
Share on other sites

I installed xcode onto my mbp but I just use the terminal (vi to write the code) and use gcc or g++ to compile, so far while learning the language it has not been bad, I am using the book The C programming language by Brian W kernighan & Dennis M Ritchie

Hope this helps

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...