For most of this week I have been in Toronto presenting a two day workshop for teachers who will be teaching Visual Basic next school year. I presented the workshop twice – for two groups of teachers from the Toronto Catholic District School Board. It was an absolutely wonderful week, in spite of Seattle Washington style weather, because of the teachers and staff at TCDSB. But as I was presenting a couple of things occurred to me. One was about how we now use “exception” where we used to use the word “error.” The other is how the concept of a fully qualified name has both software and real-world application.
Let’s take “exception” first. Older versions of BASIC, like many programming languages, would do error handling. Today we do exception handling. Why the change? At first I was thinking maybe it was just political correctness gone wild. After all error has a pejorative connotation while exception doesn’t. But the more I thought about that the more I thought that was too simplistic an answer. What we are dealing with in many cases could easily be described as an error, a mistake or something gone wrong. But really there is more to it than that. This line from the Wikipedia explanation of Exception handling (as viewed April 24 2009 at 11AM EST) “special conditions that change the normal flow of execution” is a good perspective. Of course we could get into all sorts of discussion of the word “special” as well but let us save that for another time. An exception is really some case that comes up that is different from what the program wants to handle normally. It may show up as a result of an error but in most cases it is an error only because it is being done at the wrong time – an unexpected time or just an undesirable time. Or just data in a way that we are not quite set up to handle. Picture a user entering “one” where “1” is desired.
Perhaps “error” would still be correct and I’m probably going to talk about ‘error handling” as well as “exception handling” from time to time. If you search for “error handling” on Wikipedia you will wind up at “exception handling” for what it is worth. What do you think? Am I over thinking this?
The next concept that I found myself thinking a lot about was that of a “fully qualified name.” I was asked to explain the difference between “MessageBox.Show” and “System.Windows.Forms.MessageBox.Show” In most programs I write “MessageBox” is pretty unambiguous so it is enough to specify that. But of course in other cases we can have objects/classes that really need more information. This is one of those things where context is ever so important. We have the same thing with addresses though. One example I can think about is USF when referring to a university. Here on the east coast of the US that usually means the University of Southern Florida. however on the west coast of the US it means the University of San Francisco. So it’s more than a bit ambiguous in many conversations. The same with street addresses and city/town names. I live in one of several towns and cities named “Danville” in the US. Without a state notation on the address where would one be? There is also a “Rome” in New York state but I hear there is a “Rome” in Europe somewhere as well. :-) What is the fully qualified address in that context.
So I think I will be using locations in the real world to talk about fully qualified names in the future. It seems to work as an explanation for me. How do you talk about it when teaching? Do you have another analogy? I’d love to hear about it if you do.
Speaking of teaching VB next year we are transitioning from VB6 to VB.net (2008 Express). The VB programming teacher (not me) is having all sorts of joy trying to use a VB6 textbook. So we are shopping. The primary restriction is cost. We are a Catholic school with a book budget of zilch. We are trying to find a text that is usable for a one semester novice course and yet have some chapters for a second semester. We are trying to avoid the tutorial type texts, they lack flexability. Since there a only several hundred texts out there I am try to narrow the field a bit. Got any suggestions?
I think you're close, but not spot on with your qualified names analogy. I use people names. As an instructor, the best thing is to have two people in your class name with the same first name. If that doesn't happen, ask 'em what they think about the singer Dion. Do you mean Dion DiMucci (the real Dion, by the way) or do you mean the soulless, bloodless, Celine Dion? Gotta use a fully qualified name to know!
Given that my Dion reference is often lost on youngsters, I often switch it to make it more generationally familiar.