??? 08/15/05 21:48 Read: times |
#99484 - competent programming => working program Responding to: ???'s previous message |
Absolutely that way - the result of incompetent programming is a program "working on the desk". Let me use your example - atomicity, e.g. a multi-byte variable X is modified both in main and interrupt. The incompetent programmer is not aware of the problem. There is no showing-off, he simply manipulates X in the most straighforward manner. The competent programmer knows the problem and disables/reenables interrupts upon each usage in main, except in cases where interrupt is already disabled from context. The defensive programmer requires to use a particular routine or makro for X manipulation, where he stores the interrupt flag, disables interrupts, makes the change, restores the interrupts and returns - this allows easy future changes in the required procedure. Jan Waclawek |