2019-01-19 - Improvisational Programming
Last year I took a couple improv classes and I have to say improv is very enjoyable. It's fun to just go somewhere and be silly for a couple of hours while trying not to think too hard. It's also interesting to me how improv is very similar to programming in some respects but completely different in others.
One of the reasons I signed up for improv is because I realized that a lot of my activities outside of work involved computers and when your work also involves computers that's a bit concerning. Improv seemed like it would be very human focused and not involve computers at all. I spend a lot of that computer time programming and the process of programming involves a lot of planning and refinement. You can think of a program as a script that the computer follows the best it can. As you develop that script you are repeatedly fine tuning it and making sure that it works precisely the way you want it to. Improv on the other hand skips the whole scripting step. You go up there and you just do stuff with no chance for planning or refinement. Once you are done a bit it's done forever and there's no real mechanism to redo it. Sure you can do the same game again and maybe even get the same prompt but since you didn't write down what you did last time it's hard to repeat it while also improving it. If you make a mistake while programming you go back and edit the code until it works. If you make a mistake while doing improv you just have to roll with it or run away. So in that regard programing and improv are almost opposites.
That being said the actual environment of programing and improv are both vary similar. Most programs start with the programming defining some data structures, describing what that data represents and what actions can be performed on that data but those concepts are all virtual. The data only means what it means because that's what the programming says it means. From the computer's perspective it's just a bunch of 1s and 0s and there's no difference between the temperature of a stove and the speed of a car. Improv works in much the same way with most of the scene being imaginary. The audience knows you are sitting at a table because you told them but there isn't actually a table there. You describe where you are and what you are doing. Both improve and programming require you to keep track of ideas that don't have any physical manifestation.
It's weird that I signed up for improv as a way to escape computers and programming but ended up finding that programming helps me improv better because it got me used to the idea of working within a virtual world.
2018-12-22 - In IL: Print the Alphabet (break, continue)
One final aspect of looping that we haven't looked at yet are the use of break and continue statements. These statements allow you more control over how loops progress. break statements stop the loop and move to the next statement after the loop while continue statements stop the current loop and moves execution onto the next iteration. We are going to start by looking at the same for loop we had before but with some break and continue statements added.
This loop skips over all "even" letters and stops the loop when we hit the letter k. Now let's look at the compiled code.
This looks very close to our previous for loop but with extra code to check for even letters and the letter k. In the first case we branch to the incrementing part of the loop and continue on from there. In the second case we branch to the first statement after the loop. Now we are going to make those same modifications to the while loop we had before.
Now if we compile this we expect to see the same code as our for loop since the original fore loop and while loop compile to the same code.
Now you might say the compiled code is identical to the compiled code for the for loop and you would almost be right except for one important distinction. The continue part branches to the loop conditional check and not the increment part like the for loop does. This causes the program to go into an infinite loop and never exit.
As I mentioned when we looked at for loops the main difference between for loops and while loops is what is and isn't a part of the loop from the compiler's perspective. In the for loop case the incrementing is part of the loop so the compiler makes sure that's ran even if we use a continue. In the while case we are responsible for the incrementing so the compiler ignored it and goes straight to the conditional check. This is something to keep in mind when you are using break or continue.
Next time we're going to look at some array instructions.
2018-12-04 - Parts of Speech: Determiner
Determiners are a type of adjective used to help identify which instance of a noun is being referred to. They are similar to articles and depending on who you talk to articles may be considered a type of Determiner. One important distinction between determiners and normal descriptive adjectives is that the rules for combining determiners are usually stricter. There are several types of determiners.
Demonstrative determiners continue on from where articles left off and not only indicate that a specific noun is being talked about but attempt to indicate if the instance of the noun is close by (this, these) or far (that, those). Interrogative determiners are used to make questions. Which cat is that? What cat is that? Whose cat is that? Possessive determiners are used to indicate the owner of the noun. His cat. My cat. Your cat. Joe's cat. Numerical determiners are used to indicate how many instances of a noun there are. Some cats. Several cats. Thirty cats.
Determiners can often also be used as pronouns if the noun is omitted. This cat is mine versus This is my cat.
Next time we will look at adverbs.
2018-11-12 - Bookstore Adventure
I'm a fan of books, in particular old computer books. I'm fascinated by the evolution of computers and the different ways people have found to solve the same problem. Now it's easy enough to find old computer books online, and I've bought quite a few that way, but I would like it if I could buy some in person. It's easier to tell the condition of a book in person, you can read parts of it to find out if it's a book you would enjoy and you don't have to pay for or wait for shipping. So to that end I set out on an adventure to try and find a bookstore that would sell me old computer books.
The week previous I had gone to a second hand bookstore which said that their other location had computer books so that was my first stop. It turned out that they had new second hand computer books which aren't that interesting to me. I'm sure they are useful for some people but they weren't what I was looking for. I remembered there being a bookstore on 17th ave so I looked it up on my phone. I couldn't find another mention of the one I remembered but I did find two others around that area so I walked over there to check them out.
As I was walking I was starting to feel a bit thirsty but luckily there was a gas station around the next corner so I bought some water. I managed to find one of the bookstores my phone mentioned but it turned out to be a small retail bookstore that didn't have any computer books. I found a sign for the other store my phone mentioned but I couldn't find the actual store. I found out afterwards that the store my phone mentioned had closed down 5 years ago and that the bookstore that I remembered had closed down about a year ago. My guess is that because store which had closed more recently was part of a chain there were being around to remove it from maps and things while there was no one to bother about the other store so the information on it stayed around.
After wandering around there looking for stores I gave up and decided to take the train down south to a big retail bookstore. On my walk to the train I found a paper taped to a lamp post but didn't have a chance to read it because the light changed. While waiting for the train I saw a bus stop on top of the train tracks which I found a bit worrying. I did buy some fiction books at the retail bookstore but sadly they didn't have any old computer books either.
On my way home I decided that I wanted to take another look at the paper. So I went got off at the same train station I had gotten on at and walked back towards the paper. It turns out they were annoyed because sometimes they'd miss the walk light and have to wait for it to come around again and they wanted it to work without having to press the walk button. I can kind of understand that but I don't think it would ever annoy me enough to write out a letter and paste it around town.
While walking around that area looking for bookstores I remembered seeing a large convince store. I had gotten lunch on my way to the retail bookstore but I was feeling thirsty again so I walked over there to get another drink. After that I checked on buses and luckily there was a stop just a few blocks west of there for a route that would take me home. I walked over there and managed to get there just a minute before the bus came. I always find it interesting when things just seem to work out. You make a decision which just happens to setup other things. You don't plan it, it just works out that way.
Overall the adventure was more or less a bust. I did manage to buy some books but not the books that I had set out to get. That being said the walk was excellent, I saw some interesting things and isn't that what life's all about?