Zen and the art of Coding

Lately, I have been feeling down, in regards to coding. Some call this period “the dip” or “the post-honeymoon phase”. Whatever you call it, it sucks. At the start of my coding practice, I felt challenged (as you should) but curious and hungry thinking about the possibilities to come.

A few months into the Firehose Project, we are asked to try some problem sets at Codewars (great site to strengthen your coding muscles). When I attempted the first few of these sets, I couldn’t even think about the most basic solution to the problem. This sent me reeling! How could I forget these simple, basic parts of coding? Am I stupid? Can I actually code? Is this all just a waste of time? It felt like I knew how to write articles in Spanish but I couldn’t remember how to “Hello. How are you?” ( Hola. ¿Como estas? btw).

It is never a wonderful feeling when you’ve put hours and hours into a practice only to realize you forgot your base. Perhaps I was suffering from the way we are taught to learn in school. The more I thought about it the more I realized that this has happened to me before. I had these feelings when I took up my mediation practice and Kyudo (Japanese archery). I had lost my “Beginners Mind”.

Beginners mind, Shoshin in Japanese, is a concept in Zen Buddhism that emphasizes keeping a pure and ever open mind to possibility and learning. The Zen teacher, Shunru Sunzuki, put it best in his book, Zen Mind, Beginners mind. “In the beginners mind, there are many possibilities, but in the experts mind there are few.” Hold on! Don’t I want to be an expert? Isn’t all this hard work to eventually become an expert in coding?

Yes, that is the point, eventually, but we can’t put the cart before the horse. We have to focus on what we are doing right now. I’ve been a practitioner of meditation and practiced a few martial arts. The most challenging being Kyudo. Why? The point of Kyudo is not to hit the target, it’s to go through the steps to shooting with correct form. It’s not the target but the steps leading up to the target. That is your base. The hardest concept for me to grasp was to think that archery wasn’t about hitting the target. Isn’t that why we want to shoot an arrow? To get a bulls-eye? Nope, in Kyudo it’s all about proper form and the meditative acts of leading up to the release of the arrow. The thought is that continuous practice will eventually lead on to hitting the target, but that is not the end goal. Talking to masters who have been practicing Kyudo for decades, they taught me that they constantly have to go back to being a beginner. Doing this allows them to stay open to improvement and stay grounded in their practice.

How does this relate to my coding slump? The practice of an art, whether it be Kyudo, meditation, paint, drawing, or coding (yes, these are all types of art)comes down to this: always be a beginner.

It’s OK to have to go over the basics. It’s OK to not know how to approach every problem. The key is you have to be willing to seek out the answer, mostly through google in the case of coding. Once you learn something you have to constantly practice them over and over like you are a newbie. A chef practices dicing hundreds of onions, a painter has to practice a million brush strokes, and a coder has to practice a million lines of code. These basic steps need to be reviewed and practiced with the beginners mind.

Practice of the basics is how people achieve mastery of a craft. So yes, I need to review basic arrays and Boolean, but instead of thinking “GAH! I should knoooow this already” I’ll be thinking “Oh OK, cool that is how that works.” I’m not shooting for the bulls-eye anymore but noticing how my hands hold the bow and pulls back the arrow, conscience of my form and were I need focus. Happy coding, everyone!