For the Forgetful: You Are Here
The other day I was talking with a friend and fellow developer about working on large projects or on many smaller projects simultaneously and how we cope with them. Often, you must break concentration and leave your flow to go to a meeting or to do more urgent work on an unrelated project. More mature projects can carry with them a fair amount of specific details that you need to know about to work on them effectively and you need to quickly remember and become aware of these criteria. "Shifting gears" so abruptly can cause your current focus to be lost in the near or long term.
A problem I kept encountering was that when I returned to the project I had just broken off from I would have to re-acquaint myself with what I was attempting to do. Sometimes this was easy but other times it was hard - especially when I was right in the middle of something rather complicated. One very simple but very effective trick that works for me is what I call "You Are Here".
Whenever I am pulled away from something that I am even a little bit involved in I take a few minutes before attending to my new task to write myself a "You Are Here" note right where I am in the code. I drop in the words "YOU ARE HERE" in a comment and follow it with a detailed yet brief snapshot of what exactly I was doing at the time (and sometimes why) and what my immediate next step would be if I wasn’t interrupted. This way when I return to a project I simply search for "YOU ARE HERE", read my comment, delete it and continue on. I find I can resume my flow much quicker this way.
It may seem overly simple but its not always easy to remember to do. Being diligent about things like this took me some practice but it has certainly paid off.
# Does some things. def do_things { :things => :done } end # Makes everything so much better! def improving_things(*args) options = { :awesome => true }.merge(args.extract_options!) # YOU ARE HERE # We're writing something great here and its going to make everyone's lives # easier. Currently we've got the :awesome option set and merging with the # argument's options. The next step is to check for awesomeness and raise a # SadFace exception when false. Ultimately this method should convert all # class members to Awesome class members and display some fireworks. end
Hope it helps you.