Being Tired But In The Flow & The Importance Of Fresh Eyes ...
Funny thing ... I hadn't realized that I was actually already finished with my big code refactoring project last week, until this morning as I took a moment to step back and look at things at a higher level.
In the throws of my recent refactoring work I had started to implement some new, yet small, features as the underlying software architecture was actually getting immensely easier to work with and since I needed some things to really test the reworked bits.
Over the past 5 days I implemented two important new features in the underlying architecture of my code base: (1) consolidated multi-platform touch/mouse-click handling, and (2) touch/mouse-click selection of things in a "scene".
So, this morning I'm, like, "Wow, I am so beyond refactoring now!"
But, the real topic of this post is about the work I was doing last night and how I wrapped it up this morning.
I put in a 15 hour day of coding yesterday (while, of course, taking all the needed breaks and the appropriate intake of food and coffee) because I was (a) determined to get things done, and (b) very much "in the Flow".
I had built a separate, simplified, and very targeted prototype (through yesterday and the day before) for selecting objects in a scene based on user input (touch/tap or mouse-click). With a cleaned up and fully working prototype that supported accurate selection across platforms (had to make sure things also worked with OpenGL ES for iOS and Android), I could have just finished up my day in the afternoon, patted myself on the back, and then relaxed for the evening.
But nooooo. I was "in the Flow" (or "the Zone" or whatever term you might use for this kind of state-of-mind/feeling) and, maybe more importantly, I was having fun (which is probably a key part in getting you there).
By the way, here is a nice blog post about being "in the Flow" (a.k.a. being "wired in"), from Olivet Institute Of Technology.
So, I decided to dive in and integrate the work from my "selection" prototype into the code base for my digital storytelling platform, which I knew would still take some work. The prototype was simple and not complicated by any other functionality besides the isolated task that it was designed for. The full code base for my platform, on the other hand, has been built over the past several months and has a number of somewhat complex and inter-related systems (which are nicely cleaned up and shiny from my recent refactoring).
Adding a new mechanism is definitely not just "a few hours of work" sort of thing any more. But, even knowing I was in for a pretty long day in continuing on, I still dove right in.
The time flew by and I worked straight for a number of hours (although I did take a dinner break and got out on my inline skates to enjoy the sunny late afternoon and get a tasty bento box), and got it fully integrated!
But there was crash bug ... and it was 1:30 AM.
The conundrum: I was still in the flow, but I was very tired at that point ... should I keep going?
Thankfully, experience prevailed and I remembered all the times when a fresh set of eyes found a bug in short order. So, I made a few notes, checked the code in and went to bed.
This morning, after a good night's sleep and in the awesome brightness of a sunny day streaming into my kitchen, I booted up my laptop, made some coffee, then looked into the bug.
5 minutes. That was it. And most of that was me drinking my coffee and looking out the window. Bug found and fixed. Sweet.
The big take-away here: Take advantage of being in the flow, but listen to your body, and call it a night when you are too tired ... fresh eyes the next day are your best friend!