r/C_Programming • u/TehMasterer01 • Feb 13 '26
Question How to think like a computer scientist: Learning with C
How does this book compare to the ones suggested in the wiki? I remember going through the python version a long time ago and enjoyed it. Wanting to take a look at programming again, but with C this time. Is this book worth my time, or should I instead read KNK or Effective C?
https://open.umn.edu/opentextbooks/textbooks/how-to-think-like-a-computer-scientist-c-version-1999
40
Upvotes
•
u/AutoModerator Feb 13 '26
Looks like you're asking about learning C.
Our wiki includes several useful resources, including a page of curated learning resources. Why not try some of those?
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
5
u/pjl1967 Feb 13 '26
As others have mentioned, computer science has little to do with C (or with any programming language), so the book's goal is very different from a "programming book."
Random observations:
Why does chapter 3, Function, start out discussing floating-point?
Chapter 5: Fruitful functions. What's a "fruitful" function?
The book seems to skew heavily towards math examples, which is fine, since computer science tends to do more math that, say, string processing. But perhaps you would prefer a more rouned introduction to C.
Why are
forloops introduced in the Arrays chapter?§7.9 Passing an array to a function:
I'll grant that passing an array to a function appears to do that, especially through the lens of another programming language that has true call-by-reference, but that statement simply isn't true. Whether the authors know that or think that's a simpler explanation for a beginner is unclear. Personally, I think presenting any false information, even "white lies" for the sake of simplicity, does a disservice to the reader who forms the wrong mental model.
Of course I'd recommend my own book Why Learn C whose primary goal is teaching C.
11
u/rb-j Feb 13 '26
Learning C doesn't necessarily make you think like a computer scientist. There are so many more issues that are part of Computer Science than just programming.
I'm an electrical engineer (that knows the C programming language very well) and, while I think a lot about how computers operate, I don't think like a computer scientist. I think differently.
Lotsa people are in STEM or other technical fields (even economics or social sciences) and they have to learn to program in some language or another in order to process and analyze data that they get in their field. So they learn C or Rust or MATLAB or R or something, in order to do their job. But that doesn't make them think like a computer scientist.
7
u/Keegx Feb 13 '26
So I had a quick browse through it and it doesn't look like it touches on dynamic memory allocation. So I'd say it could be decent as a starting introduction to the language, but as a learning resource you'd have to replace it pretty quickly (IMO, once pointers and malloc are learnt, thats when building your own projects should begin and take over as the way to learn).
KNK I'd say is better as a learning tool (tons of exercises), Effective C is nice but I'd use it more as a reference/lookup rather than a main learning resource (has less exercises but good info and examples).
4
u/9peppe Feb 13 '26
Not sure, but: C is very powerful if you want to think like the machine. If you want to think like a computer scientist, you already know the answer is SICP.
1
u/Level-Pollution4993 Feb 13 '26
I can vouch for KN King to be a great resource for learning C.
1
u/Yurim Feb 13 '26 edited Feb 20 '26
I skimmed over it. I didn't find anything wrong but I think any tutorial of C that doesn't even mention undefined behavior is lacking some important information.
This might work for people who want to make their first steps in C but they will need some additional teaching material for the rest.
1
u/SLOOT_APOCALYPSE Feb 15 '26
knr c89