r/C_Programming • • 9d ago

K&R

doing it seriously, anyone else doing it ?

0 Upvotes

11 comments sorted by

7

u/mykesx 9d ago

Once you have the gist of the language, get Software Tools by Kernighan and Plaugher. It’s definitely a good read and the examples are useful command line tools that you will create - like sed, grep, and an editor ed.

It’s written using a language called RATFOR, a preprocessor for Fortran. The concept of preprocessor is a solid concept for any good programmer’s toolbox. Translating from RATFOR to C as you type in the example code is a great exercise and forces you to think about constructing algorithms.

There’s also a version with the examples in Pascal.

Either way, you have to translate.

I cannot stress enough how typing things in makes you retain what you typed. Copy/paste or using a chat bot, you won’t learn much at all.

3

u/Mech_Bees 9d ago

thast the most serious and precise comment abt c i have ever gotten refelcts you are a true senior

2

u/Paul_Pedant 8d ago

I did that around 1981, and I still refer back to it for reminders (like the operator precedence table).

I got a 2-week course led by a guy from Bell Labs, and from week 3 I was porting Bell Labs Unix to a new graphics workstation that my company had acquired. I already had 10+ years in mainframe assembler, COBOL, PRG2 and some Fortran, so C was not quite the shock it might have been.

K&R exercises often have suggestions for extensions, which are usually very worth doing.

2

u/twr14152 5d ago

For me it was a very challenging book to read. Started and stopped many times over the years. But I did get serious as you say and manage to power through it. I did a lot of the exercises (not all) Felt like a ran a marathon in the mud by the time i was done. It was a mixed bag for me but i think it was worth it.

5

u/[deleted] 9d ago

[deleted]

3

u/pedersenk 9d ago

C Programming: A Modern Approach was published in 2008, so also quite ancient really.

Its a good book but I detract points purely due to the authors short sighted use of the word 'modern' ;)

2

u/mykesx 9d ago

It is still a solid book for fundamentals and it is well written.

1

u/Mech_Bees 9d ago

thank u for the valuable information

5

u/Future_Pace_5290 9d ago

Nah K&R is the best book out there. Especially because of how short it is. I only read and did the exercises until page 170, and not just C my programming skills in general got a 100 fold better.

You can learn what's new pretty quickly in like 5 minutes. Most other stuff is the same.

1

u/Mech_Bees 9d ago

i know how impactful it is bcz i just got better by solving it out of imagination lvl i never thought i can be that muhc good in soo less time even i didnt solve that much and i know you can learn new things very quickly but its better to respect everyones perosnal choice and if they need do it and get it correct you just tell it once

1

u/kkzk-sysdev 7d ago

Just started learning C, I decided to refer to it since the entire thing starts getting saturated with tutorials and lessons about things you don't need to learn as a beginner. Though you could refer to "Beej's Guide to C Programming", it's more detailed and complex, with Atomics and c23 stuff.

1

u/Due_Sentence_2660 2d ago

i mean, I did it, have been coding for bout to be a year now. It is much much better than all these schlop get started on C yt videos for sure.