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?
2018-09-01 - In IL: Print the Alphabet (Do Until)
In the last few parts we've been looking at C# loops, today we're going to look at a couple Visual Basic .NET loops. VB has a lot of the same loops as C#, with some syntax differences, but the Do Until and the Do ... Until loops are VB only. The Do Until loop is similar to the while loop except that instead of looping while the condition is true it loops until the condition is true, hence the Until keyword.
One thing you might notice about this code is the strange way the character is incremented. This is because Visual Basic .NET has different rules about implicitly converting characters to integers which requires us to explicitly convert the value to an integer, increment it, and then convert it back to being a character. Now let's compile it and see how that looks.
Except for the different instructions to increment the character this looks almost identical to the while loop version we saw previously.
Now let's look at the other version of the Do Until loop which puts the Until after the loop similar to the do ... while loop.
and if we compile that we get.
Again that looks very much like the do ... while loop we saw last time. The language gives you two ways of doing something but the compiler converts them into a single way by reversing your logic. The Until syntax is simply a tool for you to better describe your program's intentions using words.
Next time we will look at continue and break statements.
2018-07-08 - A Few Good Bugs
As a programmer a certain part of your time will be spent fixing bugs. Unexpected crashes, unhandled errors, or things not working as expected. Some times these bugs will be super simple and fixing them is trivial. Other times a bug will be almost impossible to solve because there's no clear way to reproduce it and it seems to happen randomly and never on a test machine, But sometimes you end up with a bug that falls in the sweet spot. It's hard enough to be interesting but not too hard as to be frustrating. Debugging these issues can be one of the most enjoyable activities you do as a programmer.
Ideally you want a bug that happens regularly or can be triggered without vague steps like "Press this button a bunch and sometimes something happens". It's also nice if you have logs or some other kind of trace, from there it almost becomes detective work. You look at the evidence, review trace statements, recreate the issue, build a timeline of events and figure out where things went wrong. As you investigate hopefully you will figure out what really happened. The best part is that unlike real detectives you get to change the scenario so that the next time it happens the "crime" isn't committed. Sometimes that means throwing an exception and blowing everything up but maybe that's the best outcome.
Sometimes you cannot reproduce an issue following the steps you are given. This usually means that there's something they are doing that they aren't aware of that's causing the issue. This requires watching the person go through the steps and having that "Aha" moment when you realize what they are doing and where the bug is coming from.
Of course you rarely get to choose the bugs you work on even when you are the one creating them.
2018-06-17 - In IL: Print the Alphabet (do while, for)
Last time we looked at printing the alphabet using the while look. Today we are going to look at the do...while and for loops. First up we have the do...while loop which is vary similar to the while loop except that it checks the condition at the end of the loop instead of the beginning.
Note that because the condition is checked at the end of the loop the ch will be printed at least once regardless of its value. Now let's look at the compiled program.
This looks very similar to the while loop we had last time. The only difference is the lack of the branch to the condition check at the start of the loop which makes sense since the do while loop doesn't check the condition at the start of the loop.
Now let's look at the for loop version.
and the compiled code.
This looks identical to the while loop version which makes sense given that they are doing the exact same thing. The main difference between the for loop and the while loop is where things are put. In the while case only the condition is a part of the loop syntax, the initialization and stepping of the variable are done separately. In the for loop case all of these actions are a part of the syntax of the loop. We'll see more about the implications of this later on.
Next time we will look at some Visual Basic .NET loops.



![[Valid RSS]](/images/valid-rss-rogers.png)
