Integer i = 0;
while(i < 100){
//Do something here
}
As a computer programmer and writer, I enjoy when I see parallels between coding structures and real-life phenomena.
The perfect example of this is the While Loop.
Now, for those 3% of readers that don’t know computer programming, I’ll break down what’s going on at the top of this post.
“Integer i = 0” is just a variable named ‘i’ that is of Type ‘Integer’ (or a whole number). At the beginning of this block of code ‘i’ is set to a value of 0.
Now to the While Loop. ‘i’ starts off at 0, so we get to the condition of the loop which says we won’t get out of the loop until ‘i’ is greater than 100. Then, we enter the loop. The ‘//Do something here’ isn’t really code, it’s just where whatever code you would use would be.
However, once that code is done, you get to the ‘}’ and return to top of the while loop.
And guess what?
‘i’ is still 0.
So you’re going to have to go through the loop again, and again and again, because ‘i’ is not ever increasing, it’s not going anywhere, in fact.
Congratulations, you’re in an infinite loop.
But fear not, there is a way out. All you have to do is increment ‘i’, and eventually you’ll be out:
Integer i = 0;
while(i < 100){
//Do something here
i++;
}
The ‘++’ takes the current value of ‘i’ and adds 1 to it. You can ever do something crazy like:
i = i +10;
This means that ‘i’ is increased by 10 each time, and instead of going through the loop 100 times, you’ll only go through 10 times.
Hurray! We’re out of the loop!
So what does this have to do with real life?
Simply put, we can all find ourselves in a version of the While Loop (also known as being “stuck in a rut”). As in, “While I don’t have Skill A, I can’t get Promotion B”, or “While I don’t ask out Person C, I will continue to be Lonely Loser D.”
On a personal note, I can tell you that very recently I found myself in just such an infinite loop. It all began in 2014, when I began writing a short story (the final version of which you can find here). After thinking it over for a few days, I began jotting down ideas for other short stories that would be related.
In effect, I was constructing an anthology. I ended up writing down ideas for about a dozen stories, and then began the process of slowly writing out one story at a time whenever I found the time. This usually meant late at night after my wife had gone to work (as a nurse working the graveyard shift), or on the weekend.
I would finish up the rough draft for one of these stories, then send it off to my sister to get some feedback. By September of 2014, I had written around six stories and around 23 thousand words (or about a chapter of a Stephen King novel). I wasn’t writing as quickly as I would have liked, but I was enjoying it, and was genuinely proud of what I had accomplished.
Then, came the RUT.
I’m still not completely sure why (well, that’s not entirely true, but that may be a story for another time), but all of a sudden I just couldn’t get myself to get back to writing. Oh, I would occasionally sit down and edit one of the stories I’d already written, or add a sentence here or there. But many were the nights that I would lay in bed, fully in the state of “quiet desperation”, but unable or unwilling to do anything about it.
Worse, I had mostly worked the entirety of several stories out in my head, they just had to be written out.
But I just couldn’t do it.
For about two years my anthology just sat there, bits of a digital jigsaw puzzle on my computer, waiting for me to make it complete.
And then a couple of things happened.
First, in November of 2016, my father passed away. His passing shifted my perspective on many things in my life, and completing my anthology was one of them.
And second, some advice I heard on a podcast I listen to finally struck home. The host, Adam Carolla, alluded to tackling a big project being like “eating a Cadillac.” You don’t eat it all at once. Instead, you grind it up into a powder, and sprinkle a little onto your eggs every morning. Eventually, you will have eaten the entire car.
So, that’s just what I started doing.
Write a few paragraphs one night (sprinkle, sprinkle). Go through and re-write a story so it fits better with some of the others (sprinkle, sprinkle). Sit down at the library on a day off and write for 6 hours (SPRINKLE, SPRINKLE).
In other words, I started I++ing. And, some days, I+10ing.
And eventually, I ended up with my completed anthology.
So remember, if you find yourself in an infinite loop, find a way to increment yourself, your knowledge, your abilities, even if it’s just a little bit each day. Find a way to I++.
Just a little C++ advise, so that you may C#, from your friendly, neighborhoood blogger, C Señor (If this makes 1 programmer somewhere crack up, I’ll be happy).