r/programminghelp • • Feb 06 '19

New at programming, learning C. Is k&rs book the best to start with?

So im wanting to learn low level programming (kernel and OS), and C is something o decided to learn as a first step. I have a original copy of the ANSI edition of k&r the c programming language. Is this a good starting point for a book? Ive done t first 2 examples and its quite interesting.

3 Upvotes

2 comments sorted by

4

u/07734willy Feb 06 '19

I started learning C from Zen's Learn C the Hard Way (while it was still available as a free draft online), and cannot praise it enough. The way it forces you to experiment and think beyond the scope of the problem itself (find a way to break this script, and then explain to yourself why it break it) is really powerful. There's also a python version, butI can't say much about that one though- I learned python by experience before I learned about the book. Also, while I definitely recommend supporting the author and buying the book if you can afford it, I'm imagine the web archive / waybackmachine probably has a cached copy of the free version.

Also, if you want to start into kernel / OS development, have a look at this page- that's where I started, and while it does have plenty of typos, oversights, and other problems, it also forced me to learn things "the hard way"- gaining more insight into the mechanics than if they just told me how to implement everything directly. I actually used this as a resource to start teaching two others I met on another sub how to write a bootloader / microkernel (sadly they lost interest fairly early on, but if you are truly interested in learning these things it would be a great start for you).

2

u/[deleted] Feb 06 '19

Awesome. Ill check thoese resources out. Im looking to work with atmega/arm processor's, as well as build retro computers from scratch (im currently building ben eaters breadboard 8 bit computer as an intro.i want move onto soldering up a z80 machine), so learning C, alongside Assembly, will be quite handy. I do like that c makes you write out everything just for even a simple "hello, world" command. I feel like im learning more what the code is actually doing.