Wednesday, September 30, 2015

Let x = x + 1

Let x = x + 1

The first time I saw it, my brain revolted. The math in me screamed: NNNNOOOOOO!!!!

But I kept digging, and one day found I had gradually succumbed to my present affliction: earning a living, more than full time, writing software bits.

The math part of me had learned, before I first saw this, that x is x is x, wherever it may be strewn throughout the equation. Wherever it appeared, it represented the same exact value. If it changed over there, it changes here, too, simultaneously. x = x + 1 is a mathematical impossibility.

Yet it's the way things work nowadays.

I eventually came to understand, as programmers tend to do, that x is not always x. x on the left is different than x on the right, and things which are named the same as other things are not actually the same thing. Embrace the ambiguity. Breathe it in. Let it seep down in to the very cells of your body and emit its light of illumination from within.

Let x = x + 1. The x on the left means "put the result of the stuff on the right into the spot named x." The x on the right means "use the value in the spot named x and add 1 to it to produce the result." These two xes are NOT the same, and because they are not the same, x = x + 1 is actually not a mathematical impossibility.

It's merely a Maths geek finally accepting his inner English geek.

Let x = x +1.

Forever and ever. Amen.

No comments: