3 ms·
Speaking as someone who doesn't know C, hasn't read K&R, but who (usually!) has decent reading comprehension, it _does_ come across this way. He's completely e
by aptwebapps 15y ago
Speaking as someone who doesn't know C, hasn't read K&R, but who (usually!) has decent reading comprehension, it _does_ come across this way.
He's completely explicit about what he's doing and why. I don't understand how people can read that and still feel that he's being unfair.
Maybe I'm just too literal-minded.
- ori_b 15y agoCalling string manipulation functions buggy and broken because they fail when you don't pass them a string is both wrong and silly.
- bonzoesc 15y agoHow do you test that something in C is a string?
- tedunangst 15y agoYou don't, because you can't. That's basically the same as the beginner question, "How can you test if a pointer has been freed?"
- bonzoesc 15y agoIt was a rhetorical question. What's the sense in having functions that operate on "strings" if you can't figure out what a "string" is at runtime? It's much saner to have functions operate on "strings that are 80 characters or less" or "a structure containing a integer `length` and an array of `length` chars."
- ori_b 15y agoWhat's the sense in having functions that operate on "pointers to valid memory" if you can't figure out if it's "valid memory" at runtime? The point is that the function is not buggy. You may not like the specification for it. You may think it should be designed differently. This is not the same as the code being buggy.
- ori_b 15y agoThe same way you test that a pointer is intialized to a valid value. You don't.