Very many Threads that I look at assume (for example) that if there is a line of code that detects a button press it must be immediately followed by the lines of code that cause something to happen.
Separating
- the code {A} that collects information (for example button presses or instructions over a serial link)
- from the code {B} that interprets the information
- and from the code {C} that implements actions
makes program development much easier.
For example, by seeing the job as 3 separate parts each can be thought about without the confusion of the other parts. And each part can be tested on its own.
...R