|
|
Recommendations On Learning C
|
|
|
|
Senior User
Join Date: Sep 2000
Location: Glasgow, Scotland UK
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
Junior Member
Join Date: May 2002
Location: Australia
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Sep 2000
Status:
Offline
|
|
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 ]
|
|
|
|
|
|
|
|
|
Senior User
Join Date: Sep 2000
Location: Glasgow, Scotland UK
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Sep 2000
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
|
Senior User
Join Date: Sep 2000
Location: Glasgow, Scotland UK
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Oct 2000
Status:
Offline
|
|
"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>
|
|
|
|
|
|
|
|
|
Senior User
Join Date: Sep 2000
Location: Glasgow, Scotland UK
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Sep 2000
Location: DC Metro, USA
Status:
Offline
|
|
</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).
|
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: May 2002
Status:
Offline
|
|
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
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Mar 2001
Location: Iowa City, IA
Status:
Offline
|
|
</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
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Oct 2000
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Oct 2001
Location: Singapore
Status:
Offline
|
|
Is it advisable to try learning C as the first language and for that, will "The C Programming Language" do well for a beginner?
|
|
|
|
|
|
|
|
|
Junior Member
Join Date: May 2002
Location: Australia
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Oct 2001
Status:
Offline
|
|
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
|
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Oct 2000
Status:
Offline
|
|
</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."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|