I don't really understand why the K&R is this bad
Hi, maybe it was a stupid decision to learn C from the K&R book, but I am a CS student, and I have coded a lot with C#, Python, and other languages. It is true that I am not nearly a good programmer because we don't really study the important stuff here. We spend the time learning syntax instead of the critical things, but still, I do know what a variable, if statement, loop, and all that are. I also studied architecture, so I know how binary works, how two's complement works, how the sizes of variables can be different from one machine to another, and how data gets stored in memory, like endianness. I'm familiar with all that, and I am now at 2.7, type conversions, in the book.
So you would think that it is pretty easy, right? I mean, I literally just read stuff that I already know. It's just about how C deals with it. But no, fuck no. It is so ugly and random, it got me really pissed off. Like, I am genuinely mad about this.
I love writing down what I learn, like some kind of summary or something, and I tried to do this as well here, but I couldn't. I mean, I accept that the first chapter is just a tutorial. I enjoyed the programs there, and I tried typing all of them by myself. I even solved a lot of the exercises. But when Chapter 2 started, I expected it to be like, Oh, now we are diving deep inside the language. Since there is no other chapter with the same name, this is the only thing you're going to get about this particular part from the book.
But fuck, I was wrong. It is just so simplified to the point where you aren't learning anything. And you will say, Okay, your fault, bitch, it is a book for beginners, but not just that. It is like some guy wrote it down while trying to remember what he did. Like, that whole 2.7 part is what really got me pissed off. It is like there is no consistent topic or something. We're not going from one topic to another. It is just like some guy remembered, "Oh, I have to mention this," and then he says like two words about it and moves on to the next thing.
I don't even understand. Why didn't he just go from one topic to another after explaining it fully?
For example, it says, "In general, the only automatic conversions are those that convert a 'narrower' operand into a 'wider' operand."
Then, a line after this, he says, "Expressions that might lose information, like assigning a longer integer type to a shorter, or a floating-point type to an integer, may draw a warning, but they are not illegal."
After some research, I understood that, oh, he is first talking about arithmetic conversions, and now he is talking about assigning one type to another. I don't even know if this is really what he intended to say.
But it's not just that. Suddenly, now we're talking about converting uppercase to lowercase and what could go wrong. What does this have to do with type conversion? It's just manipulating the numeric value to get the character you want. There is no type conversion here.
But wait, he uses this to introduce us to a header, which I don't even know what it is, and he just randomly starts talking about it here, completely unrelated to the main topic. Then he talks about how some of its functions could return 0 and another number for true or false, not necessarily 1 or 0.
And I'm like, I can't. I just can't put this inside my head. How the fuck is all of this related to each other? I ended the chapter and I still don't know shit about conversions. It's all just some shitty information that you could probably just guess or learn through trial and error.
And before you get mad at me, this is not me saying, "Oh, this book is dumb." I am saying I don't understand what I did wrong that made me feel like everything is so random. Am I missing something here?