|
From: | David Brown |
Subject: | Re: [avr-gcc-list] Wrong excution order in 4.1.1, but not 3.4.5, regression? |
Date: | Wed, 21 Feb 2007 11:00:36 +0100 |
User-agent: | Thunderbird 1.5.0.9 (Windows/20061207) |
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
[Prev in Thread] | Current Thread | [Next in Thread] |