C Programming: A Modern Approach

Index » 喫茶店 (Koohii Lounge)

  • 1
 
bcrAn Member
From: 名古屋 Registered: 2011-04-29 Posts: 244

I just got a copy of C Programming: A Modern Approach.

It's been a while since I coded anything. When I look back to my college years I always wish I learned programming differently, always wish I had more time to teach myself C properly, etc. Now I have the time, but I don't know what to do exactly. So bought the book and been reading it. Somehow, just reading the book doesn't cut it. I need to feel and actually work on a project but I want to stick with the book.

One idea is to transcribe the whole book, but then, what do I do with it? Another idea is to summarize the book, cutting out redundant parts (or whatever I feel like not extremely useful).

What can I do? Ideas? Please.

FooSoft Member
From: Seattle, WA Registered: 2009-02-15 Posts: 513 Website

Well, you're definitely right that the best way to learn a language is to work on some sort of project using it. However, I think doing something like transcribing the book would be a huge waste of time.

Compared to newer programming languages I find C very straightforward, and as long as you understand core concepts like pointers I don't really think it's difficult to get a hang of it. How familiar are you with programming in general? Do you know other programming languages? If you aren't, then the main thing you will have to learn to do is to organize your code properly and just get used to some common design patterns.

You said you want to stick with the book, and that's preventing you from working on a project? That seems kind of off. If I were in your position, I would just go through the book as fast as possible and then just start working on some project and go back to the book as a reference. So you might be writing some codes and be like "oh, this looks like a good place to use one of them switch statements", and then just go look it up if you don't remember the syntax or something.

Basically what I'm trying to say is don't get stuck on the book. You will never learn any programming language without going and writing your own apps, running into problems, and looking stuff up to find a solution smile

PS: Out of curiosity, is there any reason you are learning C over say C++?

Asriel Member
From: 東京 Registered: 2008-02-26 Posts: 1343

I'm not familiar with the book itself, but it seems like a large, textbook type thing.

I'm not sure what your background in coding is, but I'd say the best thing to do is just code. Read some of the book, apply the techniques they are talking about. Challenge yourself; see if you can take the things they talk about in the book and apply it in ways that they didn't mention.

I don't think transcribing a 600+ page book is going to be very effective. Writing 600+ pages of code, on the other hand, might. You'll learn better by applying the information as opposed to devising different ways of consuming it.

edit: FooSoft mentioned design patterns. Definitely look into these. I spent too much time in college studying Japanese, and not enough on my computer skills. Now I'm playing catch up with all these things that we didn't learn in class (skills that other students got from finding internships, etc...)

Last edited by Asriel (2011 October 27, 8:57 am)

Advertising (register and sign in to hide this)
JapanesePod101 Sponsor
 
bcrAn Member
From: 名古屋 Registered: 2011-04-29 Posts: 244

I already 'know' C and C++ since I have been coding for many years however, I haven't programmed a single line of code in 2 or 3 years.

Now I have the opportunity to do everything I didn't / couldn't / forgot to do before, that's why I want to start from zero (or near zero). I have a need to to go over all the concepts and, in a way, relive my college years when I learned programming.

Transcribing may sound insane, but that was just one idea, what else can I do that has to do with the book? Maybe something like a study guide / tutorial? The point of doing something is to keep track of what I am doing and provide a sense of completion, if I just read the book I know I will think I missed something later.

EDIT: C over C++ for no particular reason. I may pick up Bjarne's C++ book after this one.

Last edited by bcrAn (2011 October 27, 10:13 pm)

chamcham Member
Registered: 2005-11-11 Posts: 1444

Get the K&R (Kernighan & Ritchie) book "The C Programming Language".
Ritchie is the designer of C.

It's a computer science classic. We call it the K&R book.

As a general rule, always get the book written by the inventor/designer of
a programming language.

Something that I like about the book is that it has exercises after every
SECTION (instead of just at the end of every chapter). I wish more books
would adopt this approach. It makes you feel like you're learning things
right after you pick up the concept. A more effective teaching method in
my opinion.

jishera Member
From: California Registered: 2011-01-19 Posts: 179

Yeah, I feel the same way about programming books. A lot of the time what I need isn't even covered in the book. In that case stack overflow or other web forums are your friend smile.

Is there something you've wanted to code but just haven't? A project is definitely more useful than reading the book, and I'd argue it's more fun too. Could you program a simple game or use C as the backend to a website or something? You could use it to analyze some data....there are many possibilities.

I need to refresh my C++ and java, and I'm in a similar situation where I need a fun project.

brianobush Member
From: Portland Registered: 2008-06-28 Posts: 241 Website

chamcham wrote:

Get the K&R (Kernighan & Ritchie) book "The C Programming Language".

I would second this. I have been programming in C for 20 years (yes, I am *that* young) and use C daily to solve my problems.

Once you go through this book, find a toy problem and start solving them. I would recommend project Euler if you are math inclined. See http://projecteuler.net/

aphasiac Member
From: 台湾 Registered: 2009-03-16 Posts: 1036

Reading a programming book doesn't work. You need to start using the language asap.

My method is to work through chapter by chapter, manually typing in all the examples in your IDE and getting them to run and compile. There is a world of difference understanding the concepts in the book, and actually using them! Also play around and modify the code - just change bits and see what it does.

I like to comment every single line as I go, so i can always refer back to these code snippets later rather than having to go back to the book again.

chamcham wrote:

Get the K&R (Kernighan & Ritchie) book "The C Programming Language".
Ritchie is the designer of C.

It's a computer science classic. We call it the K&R book.

As a general rule, always get the book written by the inventor/designer of
a programming language.

While i don't agree with your last statement (not sure there's a correlation between designing a a language and being able to write an interesting book on how to use it), 'The C Programming Language'  is great and is also recommend it for beginners. Type out all the code, see if it works, by the end you'll know all the main concepts.

After that moving on to C++ i recommend 'Accelerated C++: Practical Programming by Example'. Great fun book, worked for me!

JimmySeal Member
From: Kyoto Registered: 2006-03-28 Posts: 2279

Speaking of Dennis Ritchie, did anyone else hear that he died half a month ago?  All that noise about Steve Jobs, and hardly a peep about the man whose work is at the heart of practically every technological innovation of the last 30 or 40 decades.

Reply #10 - 2011 October 28, 8:40 am
zigmonty Member
From: Melbourne Registered: 2009-06-04 Posts: 671

JimmySeal wrote:

Speaking of Dennis Ritchie, did anyone else hear that he died half a month ago?  All that noise about Steve Jobs, and hardly a peep about the man whose work is at the heart of practically every technological innovation of the last 30 or 40 decades.

Yep, Unix and C, the cornerstones of modern computing...

Reply #11 - 2011 October 28, 8:53 am
zigmonty Member
From: Melbourne Registered: 2009-06-04 Posts: 671

bcrAn wrote:

I just got a copy of C Programming: A Modern Approach.

It's been a while since I coded anything. When I look back to my college years I always wish I learned programming differently, always wish I had more time to teach myself C properly, etc. Now I have the time, but I don't know what to do exactly. So bought the book and been reading it. Somehow, just reading the book doesn't cut it. I need to feel and actually work on a project but I want to stick with the book.

One idea is to transcribe the whole book, but then, what do I do with it? Another idea is to summarize the book, cutting out redundant parts (or whatever I feel like not extremely useful).

What can I do? Ideas? Please.

I think a programming language is like any other, you'd wouldn't just write a summary of a japanese grammar book and then think you speak japanese...

I'm guessing you're looking for a way to go to the next level? You can code but don't feel you have a strong grasp on the fundamentals of the language?

My advice is the same as it is for Japanese: read. Reading other people's code is a great way to learn. Either well respected open source projects (which often have webCVS or something) or code that is trying to be tricky (google The International Obfuscated C Code Contest).

IMHO, reading a book on programming and then writing code is sorta like if you just read a japanese grammar book and then just started speaking, with no attempt at immersion. You'll get the job done, but the results will probably be awkward and brittle. Idioms, common patterns, etc are as important as syntax.

  • 1