??? 05/17/07 11:25 Read: times |
#139429 - Style Responding to: ???'s previous message |
Denis B said:
void keypad_read(void) { unsigned char keypad_scan; key = ((keypad_scan=keypad_address)&keypad_mask); key_lcd = key_table[key]; } Style is, of course, a matter of personal preference, but there are some elements of style that can bring objective benefits. The style of cramming as much as possible into a single line has a couple of disadvantages: and it almost certainly gives no advantage in the generated code. Therefore I would prefer to write it as: void keypad_read(void) { unsigned char keypad_scan; keypad_scan = keypad_address; key = keypad_scan & keypad_mask; key_lcd = key_table[key]; } Note also that increasing the indent level is conventionally used to indicate that the indented line is somehow "subordinate". There is no such "subordination" in the above code, so the lines all have the same indent level. Again, this is a lot to do with personal preferences; it's not that your style is "bad" - just that I think (subjective) that it could be "better" |