Learn C Programming Language: Tips & Resources

Click For Summary

Discussion Overview

The discussion revolves around learning the C programming language, particularly for someone with limited prior experience in programming. Participants share their experiences with various resources, including textbooks and online materials, and offer advice on effective learning strategies.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Homework-related

Main Points Raised

  • One participant suggests using "The C Programming Language" by Brian Kernighan and Dennis Ritchie, noting its concise writing style and useful exercises.
  • Another participant mentions that they found the K&R book effective but had prior programming experience, implying it may be challenging for complete novices.
  • Some participants emphasize the importance of not skipping content in the K&R book to avoid undefined behavior in C programming.
  • There is a suggestion to start writing simple programs while learning, which can help reinforce concepts from the book.
  • One participant recommends Deitel's "C How to Program" for its detailed explanations and exercises, suggesting it may complement the K&R book well.
  • Another participant appreciates the exercises in the K&R book, comparing them favorably to assignments from their class.

Areas of Agreement / Disagreement

Participants generally agree that the K&R book is a good resource for learning C, especially for those with some prior programming experience. However, there are differing opinions on whether it is suitable for complete beginners, with some suggesting additional resources may be beneficial.

Contextual Notes

Some participants note that the K&R book's conciseness may lead to gaps in understanding for beginners, and that undefined behavior in C can be a significant challenge. The discussion does not resolve these concerns, leaving them as points for consideration.

Who May Find This Useful

This discussion may be useful for individuals looking to learn C programming, especially those with some background in programming or those seeking recommendations for effective learning materials.

sanhuy
Messages
40
Reaction score
2
Hi all, I am looking to learn C by myself since it is a programming language that is used in my micro controllers class that i am going to take during the upcoming Spring semester at my university. I was wondering how i should go about doing this? I was thinking of using book The C Programming language by Brian Kernighan and Dennis Ritchie. Would this be a good idea for a person that has only taken 1 cs class that was taught in C++ (intro cs class covered stuff like datatypes, variables, functions, arrays, flow of control, and loop.) Do you have any other suggestions of materials, such as online lecture courses, different textbooks or youtube videos, that i should use instead?

kind regards,
sanhuy
 
  • Like
Likes   Reactions: Dr. Courtney
Technology news on Phys.org
That's the book I used to learn C. Worked well for me, but I was an experienced programmer when I started it.
 
I think i may just use this book. I was skimming through the tutorial chapter, and it was written nice and concisely, with a few examples and exercises, just like textbooks should be written. It doesn't to give you 20 page introductions, which many textbooks do.

do you think the text and the exercises are good enough to learn the language or is there anything else that i should be doing?
 
I think you should go through that book, THEN worry about what to do next. It really has all you need. It IS concise so you need to be careful that you don't go too fast or skip stuff.

I would also start WRITING simple (VERY simple) programs and add to them as you learn new things. I created a program called C PLAY that basically, by the time I was done, contained a usage of every construct in the book.
 
  • Like
Likes   Reactions: jedishrfu and jim mcnamara
I agree with phinds that the K & R book is a good choice, especially since you have already had a class that was presented in C++. If you were coming into C as a complete novice, I might not suggest the K & R book.
 
  • Like
Likes   Reactions: jedishrfu
Phinds said 'do not skip stuff'. He was very right. C has this nasty thing- it will let you write code that will do odd things, like crash unexpectedly. This nastiness is called 'undefined behavior'. It is hard to create in most upper level programming languages, awfully easy to do in C. Follow the book scrupulously. Code the way you learned from the book and life will be good.
 
  • Like
Likes   Reactions: jedishrfu
I concur k&r is an excellent book to learn from. Its easy to read and very concise.
 
Kernighan and Ritchie is the book by the people who originally defined C, so it is a good book. As a beginner, you may want more explanation in some places, but the internet can fill in where needed. In general, I think it is a good book for a beginner and will still be your main reference when you are an expert.
 
What I also like is that the exercises are useful. You'll have to try and think about how certain functions you'll use very often actually work.
I haven't done most of them but when I read them I liked them more than the assignments we were given for the class that used the book.
 
  • #10
K&R is definitely a good book but if you want some things explained, I'd suggest Deitel's book "C How to Program". I studied through this book and some others as well when I was learning C and I found that it is particularly good at explanations of concepts, has many exercises and projects - particularly now with the LiveCode approach, helps to develop good programming habits in general and - with no intention by my side to advertise it, it is definitely an excellent book.
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
3K
Replies
86
Views
3K
  • · Replies 25 ·
Replies
25
Views
1K
  • · Replies 15 ·
Replies
15
Views
4K
Replies
69
Views
11K
  • · Replies 10 ·
Replies
10
Views
4K
Replies
1
Views
2K
Replies
16
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K