First Things First
What is this course about?
This course is about programming using the Visual Basic language. It's written for complete beginners so I have tried to explain everything. If you're an experienced programmer, you'll probably discover that you already know a lot of what is in this course. But if you're completely new to programming, this course is what you're looking for.
If you're looking for a more complete course that covers more advanced topics, I recommend the Visual Basic .NET 2008 Express - A "From the Ground Up" Tutorial.
Lesson One Contents
Visual Basic .NET for Beginners First Things First What is this course about? Programming Visual Studio Getting Ready to Program Get VB.NET Express Get comfortable with Visual Studio Writing Your First Program The Skip Days program Program goals: Understanding what a "Windows Forms Application" is Learning how to use Visual Studio Using a Visual Basic control Understanding "event oriented" programming Writing the program code
The version of Visual Basic we'll use is called Visual Basic 2008 Express Edition and it is totally free and the course is totally free too. You can download all of the software you will need from Microsoft. We'll do that soon.
In this first lesson, we write a program that you might find useful for displaying dates on a calendar. But the goal of the course is to understand how to write a program in Visual Basic. The program we will write in this first lesson probably won't do exactly what anyone wants. But if you work through it and understand it, then you'll be able to change it and make it do what you want.
Basic was the first personal computer programming language. Visual Basic is the most recent version of Basic - and I believe - the best programming language available for most people. It was invented to help make Microsoft Windows successful. The last twenty years of Windows success tells us that worked great!
Before a computer can do anything, a program has to tell it what to do. When Microsoft Windows was first invented, writing a program that would work with Windows was really hard because there is so much happening "behind the scenes" in Windows and early Windows programs had to tell the computer how to do everything. For example, the programmer had to write code to display a "window" on a computer in the first place. Visual Basic does most of that hard work automatically. With VB.NET, you only have to think about the parts of the program that does what your application needs.
The program we will write will display a calendar and changes date displayed. If you had to write all the code to actually display the calendar and calculate the dates yourself, you might never finish the job. With VB.NET, all you do is tell Visual Basic what date to display.
You may have heard that computers only understand 1's and 0's - binary numbers - and that's true. How does a computer calculate spreadsheets, show web pages, run games, and all the other things they do with just 1's and 0's?
Look at the screen in front of you with a magnifying glass. You'll see that it's really just a series of tiny dots. Each dot is either light or dark. (Color is three dots - red, blue, or green - in one place.) So whether a dot is light or dark can be controlled by just a 1 or a 0. When the "processor" chip in a computer sees the right instruction, it will change the binary numbers that control the image displayed on the screen. (This explanation boils a lot of technology down to a really simple version, but it's still essentially correct.)
Thinking about the tiny dots on your screen again, you might be able to imagine just how busy your computer must be trying to compute what each one should be. Remember that it also has to work with pages coming in from the web, calculating how to display the cards in your game of solitaire, and the thousands of other things all at the same time. Now think about the job of sending the right commands to do all these things to the processor chip. Sounds impossible, doesn't it? That it all works billions and billions of times every day all over the world continues to amaze me.
Visual Basic is a program that creates other programs. Think of a program as being like a factory that makes things. Some factories make things you use, like a new car. Other factories make things that factories use, like a factory that makes welding machines that make new cars. Visual Basic, and all programming languages, are like that second kind of factory.
Visual Basic is the name of the programming language that we'll use. Like other languages (English, German, Swahili), it's really just a set of rules. Visual Studio is a "development environment" that uses Visual Basic. So Visual Studio is actually the "program" I described earlier. In practice, the two terms are often used to mean the same thing and that's the way I use them.
Microsoft sells several different versions of Visual Studio with different capabilities. But all versions are called Visual Studio .NET because they all use a powerful set of programs called the .NET Framework to do much of the hard work. All versions of Windows sold today include the .NET Framework and you can add it to older versions such as Windows XP.
I said that we would use Visual Basic 2008 Express Edition. That's Microsoft's "official" name for it but it's really just a version of Visual Studio. (Microsoft switches the names around too.) If you buy one of their more expensive versions of Visual Studio, you'll see that it looks almost exactly the same as the version we will use.