Top C Programming Books for Beginners: Expert Recommendations

AI Thread Summary
Recommendations for learning C programming include several notable books, with "The C Programming Language" by Kernighan and Ritchie (K&R) frequently mentioned as a classic reference. However, some participants caution that K&R may not be the best starting point for beginners due to its complexity. Alternatives like "The Joy of C" are suggested for a more approachable introduction. The discussion emphasizes that C is not ideal for first-time programmers, likening it to walking a tightrope due to its intricacies. Participants also discuss the importance of understanding the differences between C and C++, advising against conflating the two languages. For practical learning, using an IDE like NetBeans on Linux or Visual Studio Express on Windows is recommended. The conversation highlights the need for clarity on the learner's background and goals, as well as the programming environment they plan to use.
AlexVGheo
Messages
28
Reaction score
1
Hi, could anyone recommend me a good book for learning C programming? I know that there are lots of good website but I would prefer a solid book, however without reading them before hand naturally I can't determine a good one!

So any advice on this specifically would be good thank you. Or any advice on learning C in general would be very welcome too
 
Physics news on Phys.org
Do you know anything about programming, or is it your first attempt to learn programming at all?
 
Borek said:
Do you know anything about programming, or is it your first attempt to learn programming at all?

Good question.
I don't recommend C as a first programming language, it's like learning to walk on a tight-rope. You can do amazing programming tricks with it using very limited resources but it's a maze of death-traps for beginners.
To the OP:
If you're not a new programmer then this is the book to start from.
https://www.amazon.com/gp/product/0131103628/?tag=pfamazon01-20
 
Borek said:
Do you know anything about programming, or is it your first attempt to learn programming at all?

Also, what is your environment, and what is your objective? Do you really mean C, or do you mean C++? Are you on Linux, or Windows, or something else? Do you plan to use gcc, or Visual C Express, or something else as a compiler? Do you want to become a professional programmer, or do you just want to write programs for yourself?
 
I was considering it more for a bit of fun, and I have done some programming in the past like VB and Ruby and a bit of Python. I am on Windows but I dual boot with Linux if that is a better environment for doing it on. I have never written in C but I have a friend who has been trying to learn so I know at least the basics of it, like 'if' and 'while', are much the same as what I have done before.

Ill have a look at that book you linked, thank you all for the help
 
Actually if you want to start with a C-like language, I would really recommend learning C++. It will also teach you things that are not directly related to the language but to good programming skills in general.
 
but I dual boot with Linux if that is a better environment for doing it on. I have never written in C but I have a friend who has been trying to learn so I know at least the basics of it, like 'if' and 'while', are much the same as what I have done before.


If you program while running Linux, using a IDE like Netbeans can help you with some of the many details of C (and other language) programming.

https://netbeans.org/
 
I would get the classic text:

31euHZManML.jpg


As for learning C++ as suggested by another poster, I would suggest keeping a strict separation in ones mind between ANSI C and C++ (which is not strictly a superset of C). It's common for people to conflate the two. Most C code out there is standard ANSI code. If you're collaborating with other people, mixing the two will probably not be appreciated. Compilers and tools usualy have a way to make sure your code follows the ANSI standard (e.g. -ansi switch in gcc).
 
  • #10
Isn't K&R a bit too heavy for someone willing to learn C for fun?
I would suggest this book:
Miller, Quilici
The Joy of C
519uKIrMeaL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA300_SH20_OU01_.jpg

https://www.amazon.com/dp/047112933X/?tag=pfamazon01-20
(it's a bit pricey now, but look at the used copies)

It gives a step by step introduction to the language and it's not one of those "hello boys and girls, I am your new teacher so let's start looking at some funny pictures to motivate you before starting to give you - in chapter 85 - some useful information". And yet, you can almost hear someone playing the ukulele in the background.

K&R can be a useful reference, but starting with that... ugh.
 
  • #11
SredniVashtar said:
Isn't K&R a bit too heavy for someone willing to learn C for fun?

K&R can be read by anyone still in high school. It is very well written, accessible and short.

As for the above recommendation to start with C++, it's a terrible suggestion.
 
  • #12
econreader said:
K&R can be read by anyone still in high school. It is very well written, accessible and short.

I don't dispute that. But it's not exactly a very friendly text to start learning C from scratch.

As for the above recommendation to start with C++, it's a terrible suggestion.

The OP question was "Hi, could anyone recommend me a good book for learning C programming?"
I must have missed a step (the one with the increment).
 
  • #13
SredniVashtar said:
The OP question was "Hi, could anyone recommend me a good book for learning C programming?"
I must have missed a step (the one with the increment).

A lot of people seem to think there's a language called C/C++. I blame Microsoft.
 
  • #14
AlexVGheo said:
I was considering it more for a bit of fun, and I have done some programming in the past like VB and Ruby and a bit of Python. I am on Windows but I dual boot with Linux if that is a better environment for doing it on.

For windows, you can download and use Visual Studio Express for free. Or MinGW if you want something open source.

Here's a howto for Ubuntu, which will probably work for other Debian derivatives:

https://help.ubuntu.com/community/CompilingEasyHowTo

These days I never write C code. I use Python's ctypes module to interface with C DLLs and cython to speed up bottlenecks in my Python code. I still need to read legacy C code, though.
 

Similar threads

Back
Top