6 ms·
It sounds like more than a just a "style" disagreement. In the discussion of C strings, the author is arguing that Zed's arguments are nonsensical, maybe even
by ealloc 11y ago
It sounds like more than a just a "style" disagreement.
In the discussion of C strings, the author is arguing that Zed's arguments are nonsensical, maybe even objectively wrong. I write a lot of C, and the author is right in this case about C strings and undefined operations. In C you must arrange your code so that you always supply valid input to functions, there is no way around it, and it is perfectly safe once you do so.
I'd rather see discussion of the actual arguments, rather than complaints about the article's tone. :)
- knowtheory 11y agoZed's book is concretely about introducing programmers (particularly new ones or ones going from higher level managed languages down into C) to where and how C can be dangerous especially around string management. And that's why this is a style issue. Even if he disagrees with Zed's approach (and in particular how undefined behavior is discussed) it's just mendacious to claim that Zed isn't introducing his readers to the idea that one needs to be careful with strings and understand what kind of inputs one will receive. This is a critically different behavior when compared to Ruby or Python where string management is done for you, and coming from the POV of someone who's familiar with those languages... Zed's approach makes sense. Especially when the alternative being suggested is "you absolutely must go read the C spec and K&RC".