top | item 8059988

(no title)

pwaring | 11 years ago

There's 21st Century C from O'Reilly:

http://shop.oreilly.com/product/0636920025108.do

It has mixed reviews - my impression from reading it was that if you agree with the author's choice of tools, it's a good read. There's supposedly a new edition coming out in September.

There's also Learn C the Hard Way:

http://c.learncodethehardway.org/book/

I've struggled to find any other modern books on C programming.

discuss

order

clarry|11 years ago

> There's also Learn C the Hard Way

Mixed reviews applies to this book as well. For how often I see it recommended on the net these days, I am disappointed at how many annoying little lies it has in it; it's littered with them. It's also very opinionated (and in my opinion some of these opinions are bullshit) and again it likes to impose the author's choice of tools on you, to the point where he doesn't really even bother explaining how to live without them.

It could do a better job of introducing standard C terminology instead of only presenting the ideas the author came up with, and which often conflict with the concepts as defined by C. It could also do a better job of explaining C's pitfalls and UB instead of just making the reader break certain things and see how his Linux/OS X/Valgrind responds.

EDIT n+1: I just skimmed again through half of the book. Zed actually uses bstring in one of his examples. I don't know whether that should be taken as an implicit endorsement or not, but shame on him. Also, his ideas about secure string handling make me cringe. Also, his "safer" string copying function is not correct. In fact the entire book is littered with lies about strings which no doubt contribute to the confusion people have about them. I'm sure he's well intentioned and he makes good points but for someone wanting to learn how to do C cleanly and securely, I just cannot recommend this book.

aninteger|11 years ago

Ok, I'll bite. What is wrong with bstring and what do you think is a better replacement? I tried to look up criticism on Google about bstrlib and found nothing. I've used bstring in several applications without problem. I have started using antirez's sds though for newer applications.

clarry|11 years ago

Oh crap. Reading further, he does indeed recommend bstring. It wasn't just a random library in a one-off example. Some of the examples also show he doesn't care about arithmetic overflows much. I didn't find him talking about these anywhere much, either (though I skipped a few chapters).