Posts Tagged ‘Binary’

One of my favorite yoga teachers opened class the other day with an exercise that I had never seen done before although I think it’s more common in ‘softer’ yoga practices.  She asked everyone to turn to a neighbor and share a way that they use their yoga practice outside of class.  Well, since I’m an off the charts introvert (I am going to get around to writing that post one of these days), I managed to pause just long enough that as I turned to each of the people around me, they had already engaged with someone on their other side.  So no big deal, I sat and enjoyed a few minutes of meditation.

But near the end of the sharing time the teacher looked up from her conversation and commented on how relaxed I looked sitting by myself in the middle of the chatty room.  And of course she then put me on the spot to share with the entire class.  An introvert’s nightmare.  But I sucked it up and took the opportunity to very briefly share that I was volunteering to teach High School students Computer Science and since Yoga was one of the skills that was newest to me, I frequently took things I learned in Yoga to help me teach in that entirely different environment.

And this is why I find Yoga so much fun.  The response wasn’t a blank stare or a nervous laugh (either of which would be completely reasonable and somewhat expected when I allow myself to geek out in public), it was “Oh yeah, I use a programming example to help teach yoga sometimes.”  And went on to describe how she talks about how computer code reduces down to a series of zeroes and ones, each of which has meaning.  Which means that if one of those bits gets flipped for whatever reason your program may do something entirely different than what you expected.   And doing yoga is kind of like this kind of program – every instruction you send to your body is important at the most exacting level – crossing wires or flipping one bit can make your program crash or do something different than you wanted.  I particularly take this to heart in things like Chataranga (Yoga Pushups) where a very healthy exercise can quickly degrade into a shoulder injuring anti-exercise.

In any case, you should all be proud of me.  I  did not respond by breaking down the argument on the spot and trying to open a discussion about how this analogy may or may not be applicable and where it might break down.  I answered with something that I hope came out as a slightly more engaged version of “Thank You” and we went on with the class.

But since you’re here, let’s break this down a little bit.  Especially because I just reviewed binary numbers with my class and we’re going to do a check on error detection soon.  With my old Apple II which had no parity bit for its memory and had a dense enough instruction set that flipping a bit in an instruction almost certainly did something valid but different than intended I think the analogy is pretty accurate.  Especially because it wasn’t uncommon to have an occasion to program directly in machine code.  In the current world almost no-one including the deepest level system programmers write machine code directly (and yes, I know quite a few such creatures, was one myself not too long ago).  Further, with a modern computer almost all memory is error checked in some way or another so a single ‘bad bit’ will either be automatically corrected or something will error out rather than continuing to execute the error.

And now I am thinking about exceptions like Black Hat Hackers that probably do write machine code directly and certainly look for places where changing a single bit will make a program behave differently than intended.  But of course I could get myself stuck in an infinite loop here so I will stop and allow you to get back to something more important.  Like going to a good yoga class of participating in your favorite form of healthy exercise.

Or take a moment to add your thoughts on why programming and yoga (or your favorite form of exercise) are related. I bet my yoga teacher and I don’t have a corner on that market…