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 > Recommendations On Learning C

Recommendations On Learning C
Thread Tools
ntsc
Senior User
Join Date: Sep 2000
Location: Glasgow, Scotland UK
Status: Offline
Reply With Quote
May 24, 2002, 07:13 AM
 
Hi there i've decided that i want to get into writing programs this summer. I've dabbled a little in PHP with MySQL and that was quite interesting but i'm looking for something a little bit more substantial.

From what i can gather it seems that C is the best place to start since it forms the basis for many if not all the major languages in use today. If someone could perhaps recommend some literature on this i would be very greatful. I was looking and found this perhaps someone could tell me if this is worth the money given my experience.

Thanks in advance
"You can't waste a life hating people, because all they do is live their life, laughing, doing more evil."

-ALPHA ROBERTSON,whose daughter was one of four girls killed in the bombing of a Birmingham, Ala., church in 1963.
     
dogwood
Junior Member
Join Date: May 2002
Location: Australia
Status: Offline
Reply With Quote
May 24, 2002, 07:31 AM
 
You sound just like me. I am also moving from PHP to Java. So I have started learning C. The Seminal book on C is "The C Programming Language" by Kernighan & Ritchie. Ritchie invented C so it is form the source lets say. It is also the primary text on C at college and it is short book 200 pages as well.
     
Marshall
Forum Regular
Join Date: Sep 2000
Status: Offline
Reply With Quote
May 24, 2002, 07:39 AM
 
Originally posted by ntsc:
<STRONG>From what i can gather it seems that C is the best place to start since it forms the basis for many if not all the major languages in use today. If someone could perhaps recommend some literature on this i would be very greatful. I was looking and found this perhaps someone could tell me if this is worth the money given my experience.</STRONG>
I don't have the book (yet), but I spent some time looking through it and reading the first few chapters. It looks very good both technically (as it should be, considering Dennis Ritchie created the C language) and as a learning tool. There are lots of exercises to go through to solidify the concepts.

It assumes that C is not the first programming language you've ever learned, but as long as you understand PHP fairly well (variables, loops, functions, included files, etc.) you shouldn't have a problem at all. In fact, you'll probably recognize a lot of the syntax.

I'd say go for it.

(Edit: Fixed up the quote)

[ 05-24-2002: Message edited by: Marshall ]
     
ntsc  (op)
Senior User
Join Date: Sep 2000
Location: Glasgow, Scotland UK
Status: Offline
Reply With Quote
May 24, 2002, 08:03 AM
 
Excellent, thanks for all the feedback.

One other thing that occurred to me is what do i need in Mac OS X to get started? i have the dev tools installed but i probably wouldn't know how to go about using them for C Development. Can anyone give me some pointers?
"You can't waste a life hating people, because all they do is live their life, laughing, doing more evil."

-ALPHA ROBERTSON,whose daughter was one of four girls killed in the bombing of a Birmingham, Ala., church in 1963.
     
Marshall
Forum Regular
Join Date: Sep 2000
Status: Offline
Reply With Quote
May 24, 2002, 10:50 AM
 
Originally posted by ntsc:
<STRONG>One other thing that occurred to me is what do i need in Mac OS X to get started? i have the dev tools installed but i probably wouldn't know how to go about using them for C Development. Can anyone give me some pointers?</STRONG>
First of all, for initially learning C, all of your development is going to be command-line based, so you need to be familiar with Terminal.

I would suggest using Project Builder as your editor, but compiling and running your programs from the command line. To do this, start Project Builder, choose "New File..." from the File menu, and give it a name ending in .c (e.g. "myfile.c"). You won't need a header file immediately, so you can un-check the "Also create myfile.h" option. Select a location to save the file, and click "Finish". You can ignore the project and target options.

When you've written your source code and saved it, go into Terminal, cd to the directory in which your source file is saved, and type:

cc myfile.c

This will create an executable file called "a.out". You can run it by typing:

./a.out

If you want to give it a more meaningful name while you're compiling, you can compile using the -o option. For example:

cc -o myprogram myfile.c
./myprogram

Once you start developing programs that use a bunch of different source files and headers, you'll probably want to start creating projects in Project Builder to manage them (using the "Standard Tool" project type). For now, though, keeping it to just a file editor and Terminal is probably the simplest way to get going.

Hope this helps.
     
ntsc  (op)
Senior User
Join Date: Sep 2000
Location: Glasgow, Scotland UK
Status: Offline
Reply With Quote
May 24, 2002, 12:23 PM
 
Cool, thanks Marshal. That looks like it would probably work. Its just that i've never had to deal with the whole compiling thing before

Thanks for your help!
"You can't waste a life hating people, because all they do is live their life, laughing, doing more evil."

-ALPHA ROBERTSON,whose daughter was one of four girls killed in the bombing of a Birmingham, Ala., church in 1963.
     
Chaaaosss
Forum Regular
Join Date: Oct 2000
Status: Offline
Reply With Quote
May 26, 2002, 04:38 AM
 
"A Book on C" by Al Kelley and Ira Pohl is excellent as well.

As far as learning C for ultimately programming on the Macintosh, pick up "Cocoa Programming for Mac OS X" by Aaron Hilegass (thumb through it at the bookstore and you'll never, ever want to program in Carbon). It will teach you Objective-C (it's sort of an object oriented "version" of C that doesn't take long to learn once you know your way around C) and the Cocoa frameworks.

For Carbon (if you're familiar with Mac programming or you want to work in the Final Cut Pro group at Apple or the Photoshop at Adobe, as essentially any legacy program will still be using Carbon), find a copy of CodeWarrior and this:

<a href="http://www.mactech.com/macintosh-c/" target="_blank">http://www.mactech.com/macintosh-c/</a>
     
ntsc  (op)
Senior User
Join Date: Sep 2000
Location: Glasgow, Scotland UK
Status: Offline
Reply With Quote
May 26, 2002, 07:40 AM
 
Yeah that was kinda the long term plan

Phase 1 : Get into C
Phase 2 : Get into ObjC and Cocoa

Cocoa looks really cool and from what i can tell the work involved in getting a decent Carbon app out there is significantly more compared with Cocoa.
"You can't waste a life hating people, because all they do is live their life, laughing, doing more evil."

-ALPHA ROBERTSON,whose daughter was one of four girls killed in the bombing of a Birmingham, Ala., church in 1963.
     
ophion
Fresh-Faced Recruit
Join Date: Sep 2000
Location: DC Metro, USA
Status: Offline
Reply With Quote
May 26, 2002, 03:57 PM
 
</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">quote:</font><hr /><font size="1" face="Geneva, Verdana, Arial, sans-serif">

<a href="http://www.mactech.com/macintosh-c/" target="_blank">http://www.mactech.com/macintosh-c/</a></font><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">Once you have learned C, I also highly recommend the above book for learning the Toolbox (chunks of which you will need to know even if you decide to code to the Cocoa API).
     
serversurfer
Fresh-Faced Recruit
Join Date: May 2002
Status: Offline
Reply With Quote
May 26, 2002, 08:43 PM
 
I can't find "The C Programming Language" or "A Book on C" at O'Reilly Safari. Any suggestions? They have "The Waite Group's C Primer Plus 3rd Edition". Does anyone know anything about that? Can anyone recommend any good C books I could find at Safari?

I'm already subscribed to Safari, if you haven't guessed. <img border="0" title="" alt="[Wink]" src="wink.gif" />
Love,
The Surfer
     
Amorph
Dedicated MacNNer
Join Date: Mar 2001
Location: Iowa City, IA
Status: Offline
Reply With Quote
May 26, 2002, 10:13 PM
 
</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">quote:</font><hr /><font size="1" face="Geneva, Verdana, Arial, sans-serif">Originally posted by serversurfer:
<strong>I can't find "The C Programming Language" or "A Book on C" at O'Reilly Safari. Any suggestions? They have "The Waite Group's C Primer Plus 3rd Edition". Does anyone know anything about that? Can anyone recommend any good C books I could find at Safari?

I'm already subscribed to Safari, if you haven't guessed. <img border="0" title="" alt="[Wink]" src="wink.gif" /> </strong></font><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">I suggest you go somewhere that does have The C Programming Language (pretty much anywhere), because there's no substitute for it.

It's not cheap, but it's absolutely worth it.
James

"I grew up. Then I got better." - Sea Wasp
     
Chaaaosss
Forum Regular
Join Date: Oct 2000
Status: Offline
Reply With Quote
May 28, 2002, 02:55 AM
 
Yeah, just buy "A Book on C" and "Cocoa Programming for OS X" from Amazon or Borders. It is definitely worth the investment. With those books, I guarantee you'll end up trying to print the entire book out anyway; might as well just buy it.
     
daftpig
Forum Regular
Join Date: Oct 2001
Location: Singapore
Status: Offline
Reply With Quote
May 28, 2002, 06:06 AM
 
Is it advisable to try learning C as the first language and for that, will "The C Programming Language" do well for a beginner?
     
dogwood
Junior Member
Join Date: May 2002
Location: Australia
Status: Offline
Reply With Quote
May 28, 2002, 06:45 AM
 
C is well worthing learning as a first language. It is in many the conceptual and practical grandfather of most languages in use today. Objective- C, C++, Java, C# etc. The concepts learnt in C, will help you whole growth as a programmer.

The C Programming Language is the seminal work of the C language. Nothing to be more said.
     
Purpendicular
Fresh-Faced Recruit
Join Date: Oct 2001
Status: Offline
Reply With Quote
May 29, 2002, 05:00 AM
 
As the next book after the K&R C programming language, I would recommend P van der Linden "Deep C secrets". It explains a lot of the finer points of C that might be touched upon by K&R but that you won't notice or understand the first couple of reads.
Deep C secrets is also one of the funniest books you are likely to come across, programming book or not.

Erik
     
skipjack
Dedicated MacNNer
Join Date: Oct 2000
Status: Offline
Reply With Quote
May 29, 2002, 05:37 AM
 
</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">quote:</font><hr /><font size="1" face="Geneva, Verdana, Arial, sans-serif">Originally posted by Purpendicular:
<strong>... I would recommend P van der Linden "Deep C secrets"...
Erik</strong></font><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">I really like that book! The full title is "Expert C Programming: Deep C secrets". The Library of Congress lists it as "Expert C Programming!". Your local library might list it that way, depending on how meticulous the cataloger is.

Here's the Dedication:

"I hereby dedicate this book to pizza, Dalmatian dogs, Sunday afternoons ina hammock, and comedy. The world would be a lot better off if there were more of these. I plan to become reacquainted with them all now the book is done.

In fact, I think I'll spend next Sunday afternoon swinging in a hammock, and laughing at my Dalmatian dog's attempts to eat pizza.

I would also like to acknowledge the fine products of the Theakston Brewing Company, Yorkshire, England."
     
   
Thread Tools
 
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 04:03 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.,