Kata :: One move at a time, sequentially
Dealing with disappointment
Problem solving can sometimes be a frustrating process. My 2yo boy started walking just around his 1st birthday, which is when all the fun really started!
He would regularly wander into my office, pick up my wireless mouse, and would then proceed to get distracted by something else, dropping my mouse in the weirdest places!
Realising this penchant for behaving like a magpie, when my car keys went missing one day, I was certain that our little darling was behind it. I decided that in order to find these keys, I'd need to change my thinking to that of a 1yo and look in places that he liked to frequent. It involved trying things like crawling on my hands and knees in order to get his perspective on life...
Car keys (along with house and other keys) are valuable, so I was stressed throughout the process. I did however appreciate what kind of situations the little tike faced on a daily basis.
Unfortunately, even the best laid plans can come undone. To this day I haven't found the keys, so either my thinking wasn't quite right, I made an incorrect assumption or I'm to blame for the disappearance. We ended up having to make a copy of our spare key, not an ideal solution, but one that gets the job done.
In the same way when tackling the deBee function this week, I wanted to nail those bees in one line of code. I was trying to avoid using the toLowerCase() method, as I figured I could filter out the buzz words by using a case insensitive match, but unfortunately I couldn't quite figure out how to do it yet.
Thus I relented and used the toLowerCase() method to convert all instances of buzz to be the same. It only took 2 lines of code, so was quite elegant, and I think I could have still changed it to one line of code, but sometimes you just have to settle for what works! Elegance comes with experience, so will look forward to the day that I can craft elegant code on a regular basis.
Figuring it all out
Rubber Ducky :: is a fascinating method, as it invokes some interesting psychological processes. I haven't really used it much, but I think I will in future kata practice.
Pseudocode :: is my go-to method for working through a problem. I find more often than not that I can get through 90% of solving the problem with this approach.
Trying something :: is the next cab off the rank. Sometimes it works, somtimes it doesn't.
Reading error messages :: is my next port of call if the previous approaches fail. I've started to learn about things that I regularly get wrong, and the error messages are very usefull in determining where I'm found lacking. If I can't figure it out, I tend to reach for uncle...
Google :: is a valuable tool in this regard. There’s a scripture in the bible that states:
"there is nothing new under the sun” - Ecclesiastes 1:9 NIV.
If you run into a problem, chances are someone has done so before you and solved it. So rather than reinvent the wheel, research can help you save time, if you know how to utilise a search engine well.
Asking a peer for help :: is something I do when I get really stuck. This sometimes helps, and sometimes not. But I think it's really valuable collaborating with someone to solve a problem.
Asking my coach for help :: is my absolute last resort. Joseph has been great in asking me questions to help me figure out the problem on my own, rather than just spoonfeeding it to me. Sometimes I need some spoonfeeding if I just don't understand, but it's a lot more edifying if I don't have to go down that route.
Reflection :: is what I'm doing here, and it's very valuable, as I've figured out that I do have a sequence that I do things in. Reflection also helps identify what things I should practice more and what I should do some further research on.
Overall, I've enjoyed this sprint, and going into the Kata I was quite confident. The first 4 kata took about 5.5 hours to finish, but the built-in methods kata knocked my confidence slightly. I think I'll leave the JS Olympics for the summer break.