How playing with a Rubik's Cube has made me a better developer
My brother in law bought a Rubik’s Cube at a yardsale for a quarter. He was playing around with it when he and his wife stopped by our house. I’ve never personally owned a cube, but I had seen them around (more so when I was younger).
From here on out, I’m going to refer to the Rubik’s Cube as a cube, and each of the individual cubes on the cube as a cubie.
However while he was playing with it, I became a bit intrigued, and even tried turning a few. I sucked at it. He left it at my house and I dinked around with it. After a while, I the cheated, googling for a solution.
In case you haven’t heard of different strategies to solve a cube, one strategy suggests solving one side (the top), and then solving the next two layers. You then flip it around, and do some rotating hackery to finish the puzzle.
I solved it once using that resource, but I was far from being able to do it on my own. I gave it back to him, (after reseting the cube of course), and forgot about it for a couple weeks.
We saw each other again, and he passed the cube back to me. Instead of immediately cracking open the laptop, I tried to finish the first half on my own. And even though I knew where cubies were supposed to go, it was still hard as hell. I would find a cubie, and keep wanting to pick it up (outside of the cube) and replace it with the cubie that was taking its spot. A lot of cursing ensued.
After 30 minutes working on the same cubie, I accidently moved it to the correct position. I deciphered how I did it, and then an “Aha” moment hit. I was looking at the puzzle in the wrong way. A quote from The Matrix popped in my head.
*Spoon Kid - “Do not try to bend the spoon. That’s impossible. Instead… only try to realize the truth.” *Neo - “What truth?” *Spoon Kid - “There is no spoon.” *Neo - “There is no spoon?” *Spoon Kid - “Then you’ll see, that it’s not the spoon that bends, it is only yourself.”
A bit enigmatic for a toy, true. But it nailed the idea. I was trying to force the cubie into the spot, and instead of forcing it, I needed to look at the puzzle differently to see how the cube itself can shift to accommodate the cubie. Which generally meant rotating a side that I wouldn’t have thought about before. After that, first half of the puzzle fit together easily.
The next day, I thought more about the cube. Most of my frustrations with programming and/or customer requests have similarities. I try to force a different way of thinking or designing code into a tool that doesn’t easily accommodate it, or think what the customer is really asking for it too complicated / costly to implement. By stepping back and either turning the problem “on its head”, forgetting the “mental baggage” I was bringing from a different language / paradigm, or suggesting an alternate solution that will take the customer 80-90% of the way, I become much more effective.
Now I only mentioned solving the first half of the puzzle. A much easier approach to independently solve the second half was to memorize the algorithms, and that wasn’t exactly a walk in the park for me. But it stretched my memory muscles, which if you know me you’ll already know I’m pretty weak in that department, and it provided the satisfaction of being able to complete the puzzle. The next step would be to analyze each of the algorithms and actually understand how they really work.
Playing with a Rubik’s Cube, is a great way to experience looking at a problem in a different light in order to solve it.