The program has two buttons and a text output area, The program greets the user. When he or she clicks the Display button, the program displays "Hello my friend!" It adds another "Hello my friend!" to the greeting every time the user clicks the button. When the user clicks the Stop button, the programs stops executing.
That is an external description of what the program does, and it is written in a natural language: English. An English speaking person could understand this description, but a computer could not.
A programmer had to write instructions for the computer, telling it what to do when each event occurred. Those instructions were not in English, but in a programming language: Visual Basic.
If a programmer wanted to talk about the program -- either in explaining it to another programmer or in planning it before writing it -- he or she would not use colloquial English, as in the external description, but would use the precise technical language we are learning to use in this course: Geek.
For example, you could describe the "Display the Message" event handler in three languages:
English | Add "Hello my friend! " to whatever is in the greeting area on the screen. |
Geek | Append the string "Hello my friend! " to the value of the Text property of the TextBox named "txtOut." |
VB | txtOut.appendtext("Hello my friend! ") |
In writing an event handler, a programmer should plan in English then translate to Geek and finally to Visual Basic. Translation into Visual Basic is the last and easiest step in writing the event handler.
This is awkward now, because you are not used to thinking in Geek. A major goal of this class is to make you easy with this precise new language.
We have already seen that we could describe user interfaces in Geek. For example, here is a description of the Stop button:
English | The user interface has a button that says "Stop the Program." |
Geek | The user interface contains an object which is an instance of the class Button. The name of that object is "btnStop" and the value of its Text property is "Stop the Program." |
VB | Good news! The VS.NET development system automatically generates the VB instructions to create the button for you. |
Once you understand what you want the computer to do (external description in English) you can plan the structure of your program (in Geek) and finally write the event handlers in a programming language (VB in our case).
The bad news is that you have to learn two new languages: Geek and VB. The good news is that once you are fluent in Geek, it is relatively easy to learn new programming languages.