For #1, I try to pick a task that's closely related to the main task at hand. I think related tasks can help retain focus rather than losing it by shifting gears.
For example, while my code is compiling, I might think through the specific steps I'm going to take to try it out when I run it here in a minute. Or try to plan out the next change I'm going to make to the code if this current code works. Or start a list of some unit tests I need to add.
For example, while my code is compiling, I might think through the specific steps I'm going to take to try it out when I run it here in a minute. Or try to plan out the next change I'm going to make to the code if this current code works. Or start a list of some unit tests I need to add.