tags:

views:

301

answers:

6
+5  Q: 

k&r C trouble

This is a quick slightly subjective question I need to ask. In order to become a proficient C programmer, I felt I'd learn C from the k&r. I find the book a little easygoing, difficult to understand sometimes but easygoing on the whole.

My question here is, do I have to absoultely do all the exercises (even those that stumped me) to become a proficient programmer in C? Or can I skip most of them? The format and layout of the questions asked are ... difficult, at best without using the tools available to C's rich set of libraries.

Thanks and don't bash on me!

A: 

I'm not sure K&R is the correct resource to learn modern C, especially since C has come quite a long way since the K&R days.

Anyway: when it comes to exercises, you should especially do those exercises that stumped you. Your goal is to learn things, not to get through the book the fastest way possible.

Joachim Sauer
+2  A: 

I think K & R is a very good resource to start learning C.I think you should try and get at least 80% of the questions on your own, even though a lot of the questions asked is rewriting libraries, it helps you to start thinking in "C".

fARcRY
+1  A: 

I learned C from K&R (first ed, a long time ago) and never did any of the exercises. I don't claim that this made me the brilliant programmer I am today, but it doesn't seem to have done me any harm either :-)

anon
Was C your first language?
+6  A: 

First, best of luck with your learning of C.

What to do to become a proficient programmer per se, is something very very crude. I will answer that with an analogy. You may complete all the exercises at the end of the book, but fail to complete the first practical program you are assigned to work upon. In another case, you might have failed to complete any exercise but yet you are able to complete your first assignment. Who do you think is in a better place? I would leave the discussion to interpretation.

Exercises at the end of the book are meant to make a person going through the text familiar with nuances of problems, code situations, programming techniques. These generally are meant to test the practical implementation of the text you might have just read. These are problems which would give you an oversight of what come in usually in daily practice. As with any exam, if you are unable to solve one particular problem, it does not mean that you are don't know anything.

My suggestion would be to try all the problems. Mark down which stumped you and revisit them after some time when you have a better grasp of the topic, may be after you solved some more problems, or went through another good resource.

Try and read more on the topic using the Internet or elsewhere.

As for the book, any book that makes you understand is good, if it fails, its not worth for you.

Have fun and Keep Walking !!!

Sandy
A: 

Even a proficient programmer doesn't know everything about the language; you should try and do the exercises that you find difficult - if you try something challenging you'll learn something along the way.

Perspx
+4  A: 

You need to do all the exercises. Then you need to spend 10 years suffering the pain of C. Then you get to be initiated into the conclave with yak blood.

But, seriously:

You learn by doing. Whether you prefer to do by completing all or some of those exercises is irrelevant. Myself, I would do as many as I could, then choose a project I'd enjoy.

For me, that would be a text-mode share portfolio manager, you're likely to have other interests.

But you'll learn faster if you're using it for something you enjoy - that's unlikely to be anything to do with the exercises in K&R.

paxdiablo
guns