You have read the
bible, yes?
I have read through some chapters of this book kind of carefully. I think the examples they give are outdated in some contexts.
The reality in my view is that C is a language that has some severe design flaws. C strings themselves have probably caused billions of dollars of damage due to the way they are designed and the confusing use of buffers, which are only worsened by the attempt at safe string functions which aren't safe at all.
Fun fact: the C standard actually does not specify a whole lot of things people take for granted. For example an int, which most people assume to be 32 bit, is actually only
at least 16 bit, so depending on what machine you target, it could be 16 or 32 or even something else, which is kinda crappy. Same for a char, which is not guaranteed to be 8 bits or a standard byte, but only at least 8 bits, and could be signed OR unsigned, due to some historical reason or something. AFAIK the standard doesn't even enforce using two's complement, for the 0.0001% of machines that don't or something. You will never encounter this in 99.999% of your coding, but it's unsettling that it is this way. In the book, a lot of the exercises are text operations based on the assumption that all text uses ASCII and one character is one byte, where in the land of unicode fuckery is just not true. I know Unicode fuckery is an immense topic where in theory someone could enter ancient Mesopotamian hieroglyphs so I'm not gonna pretend that it's an easy topic. I have not even touched upon pointers. The lack of exceptions makes error handling harder and the hack using setjmp and longjmp makes the code significantly harder to reason about.
I planned on writing a whole blogpost on this on my personal spergery blog but it ended up being so long because I looked through the C standard and found so many confusing points.
I have a friend who is now a Rust autist but I am not so eager to pickup a language. I think I'll try to find a subset of C++ I am comfortable with (because the design philosophy of C++ was to include everything possible under the sun into one massive behemoth of a language) and try to write clean code with that.
Sincerely, an uninformed programmer who mainly writes in little python scripts. Sorry
@AmpleApricots. I cannot even keep track of all the weird little C gotchas that exist in the language.