Graham Davies wrote:
David Brown wrote (in part):
There are at least two of ways to interpret "a = b = c" while
maintaining right-to-left associativity, when the variables are all
volatile:
You're right. I was wrong. I should have taken more time to understand
the nature of the problem. Especially given the well-chosen text of the
subject.
Code which is unclear to the writer and to readers is bad code.
I agree. Different definition of the word "wrong", but bad code = wrong
code works for me.
Humbly, Graham.
I sometimes get a little fanatical about what is "bad" or "wrong" code.
For example, I'd say the following function is bad code:
int square(int x) {
int doubleX; // This holds x + 3
doubleX = x * x; // Find the square root
return doubleX; // Return a random value
}
This will certainly implement a "square" function, but having incorrect,
misleading or unclear names and comments is as bad as a functional
error, IMHO.
Being a little fanatic, and having my own rules about what parts of C to
use or not (for example, the comma operator does not do what a comma
operator should do, and thus I never use it), my comments are not always
clear to anyone other than myself.
Best regards,
David
_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list