Posted: Wed May 21, 2008 4:49 pm
Let me respond to some of the arguments leveled against me.
In regards to the whole fiasco about pointer arithmetic:
Yes. You can say you don't like it, but the fact is it is well understood. Therefore, statements such as C can't do arithmetic or C doesn't know math is simply stupid. This is also what I meant by personal attacks on C. C does know arithmetic and its semantics are understood by almost everyone. If you don't like it, its your own opinion, but that doesn't make it bad.
Secondly, I made a mistake when I said a pointer is an integer. I should have stated that it is stored as an integer, but that it is different from an integer and that therefore, its semantics are different.
About the assignment operator as a conditional. I believe that in C, an assignment returns the value of what was assigned. I also know that any number aside from 0 is considered false. Therefore, to anyone who knows C, the semantics of these operators are understood. The idea of equality and assignment are distinct and your brain thinks about them differently. Therefore, anyone who has been trained in C would only make this mistake because of a typo. Then again, anyone trained in C would try to eliminate all warnings...
In regards to the whole fiasco about pointer arithmetic:
Yes. You can say you don't like it, but the fact is it is well understood. Therefore, statements such as C can't do arithmetic or C doesn't know math is simply stupid. This is also what I meant by personal attacks on C. C does know arithmetic and its semantics are understood by almost everyone. If you don't like it, its your own opinion, but that doesn't make it bad.
Secondly, I made a mistake when I said a pointer is an integer. I should have stated that it is stored as an integer, but that it is different from an integer and that therefore, its semantics are different.
In C, the semantics of how a pointer works is understood and in C, it does have the concept of next. Since when did pointers not have the concept of next? would be the complementary and none the lesser question.Since when did pointers get a concept of next?
About the assignment operator as a conditional. I believe that in C, an assignment returns the value of what was assigned. I also know that any number aside from 0 is considered false. Therefore, to anyone who knows C, the semantics of these operators are understood. The idea of equality and assignment are distinct and your brain thinks about them differently. Therefore, anyone who has been trained in C would only make this mistake because of a typo. Then again, anyone trained in C would try to eliminate all warnings...
Come on, if you're telling me that you can write a program of sufficient in some language other than C and not make a single mistake, then I shouldn't even be having this conversation.I read somewhere that K&R never intended for C to be used without lint. I wonder if there's any truth to that.