The History of Basic
Throughout the history of modern computing, there have been many computer programming languages invented, most of which have not lasted the test of time. In 1963, Kemeney and Kurtz produced BASIC – Beginner’s All-purpose Symbolic Instruction Code. BASIC proved a very popular language for students to learn programming and many universities started to teach programming in BASIC.
By the mid 1970s, as personal computers became cheaper and more widely available, people started owning their own, but most people found they were still hard to program. In response to this need, Bill Gates and Paul Allen produced a version of BASIC and started selling it from their newly formed company, Microsoft.
Over time, Microsoft’s premier product turned out to be the Windows Operating System (a revision and extension of their original MS-DOS, which included the now familiar graphical interface). But writing programs to run under it was very difficult and often required computer experts to undertake development tasks. In 1991 Microsoft released Visual Basic, which enabled beginner programmers to write for Windows. Visual Basic has been upgraded several times; at the time of writing this course, the latest version of Visual Basic forms part of Microsoft’s Visual Studio.NET 2008. Visual Basic 2005 uses Visual Basic version 8. Today, it is one of the most popular programming languages, which has matured to enable not only hobbyist programmers, but professionals as well, to produce business class programs.
WHAT IS MICROSOFT.NET?
At the turn of the century, rather than continue to make incremental improvements to Visual Basic, Microsoft decided to introduce a major new product, the .NET framework, which includes Visual Basic, C#/C++ along with features to enable building interactive and eCommerce websites.
Microsoft explains the concept of .NET in these words:
“Microsoft® .NET is a set of Microsoft software technologies for connecting information, people, systems, and devices. It enables a high level of software integration through the use of Web services – small, discrete, building-block applications that connect to each other as well as to other, larger applications over the Internet.”
Microsoft’s .NET platform was released in 2001 as a new feature to their Windows family of products. This affects many aspects of Information Technology because Windows products are responsible for a major share of home and office computers systems and website servers on the Internet. The technology behind .NET allows programmers (often called ‘developers’) to create software programs or applications that utilise the wide spectrum of information technology resources used every day by people around the world.
A New Approach to Building Windows Software
The .NET Framework simplifies Windows software development. It provides developers with a single approach to build both desktop applications (sometimes called ‘smart client applications’) and web-based applications. It also enables developers to use the same tools and skills to develop software for a variety of systems ranging from handheld smart phones to large server installations.
Software built on the .NET Framework can be easier to deploy and maintain than conventional software. Applications can be designed to automatically upgrade themselves to the latest version. The .NET Framework can also minimise conflicts between applications by helping incompatible software components coexist.
PROGRAMS
A computer is a machine that performs a given set of instructions – these instructions are called a program. A computer program is the formalised set of instructions about how to perform a given task or tasks, and is not unlike a recipe for baking a cake. Just like a recipe, in a computer program you identify the ingredients (called variables in a program) and in a careful sequence of instructions (called statements in a program), describe what to do with them to achieve the final result.
When we write computer programs, we use what is called a ‘high level language’ or programming language. Visual Basic.NET is an example of a high level programming language. Most programming languages have similarities to English (e.g. words and structures) that can be fairly easily understood by people. Using the syntax and vocabulary of the programming language, a developer writes a detailed set of instructions, i.e. a program, of what the computer is required to do.
Keywords (also called Reserve Words)
A programming language contains a set of keywords, which form the vocabulary of the language. Generally, most programming languages have only 100 or so keywords, which can be quite quick and easy to learn. Examples of some Visual Basic .NET keywords include:
- Private
- Dim
- New
- If, Else, ElseIf
- End
- Loop
Keywords are used to write the instructions that form a program. These words cannot be used as variable, class, method or property names (more about classes, methods and properties later). A complete list of Visual Basic .NET keywords can be found on the MSN website – refer to Appendix 2 for more information.
Sequence
When writing a list of instructions, it is usual to start off with the first step and then list each subsequent step in the appropriate order until the task is fully described. The same principle is used when writing computer programs. In a program, the order of the instructions (also called statements), is referred to as the sequence of the program. The sequence of instructions in a computer program is very important as a computer will execute them exactly as they are written, from first to last.
Selection
In some cases, it may be necessary to choose between two or more options to complete a task. For example, a description of going shopping might be: if it is not raining walk to the shops, else if it is raining, drive the car. In this case, what happens is dependent on a condition (whether it is raining or not). In a computer program, choosing between different options is called selection.
Repetition (or Iteration)
Many complex tasks are in fact, built up of smaller tasks repeated until the overall task is achieved. A good example of this is a piece of music, where it is common for a sequence of notes to be repeated periodically throughout the whole piece, e.g. a chorus repeated at the end of each verse, or a base line which repeats continuously for the whole song. In computer programming, there are times when repeating a task is required, for example, adding a list of numbers is a repetition of adding a number to a total, until the final total is calculated. In programming, repetition is commonly referred to as looping or iterating.
Methods
The bigger a task is, the bigger the list of instructions. To make programs more manageable, they are usually broken up into smaller sub-sections, which describe a discrete task; a smaller logically separate set of steps. These separate sections are called methods (or sometimes functions, procedures or subroutines) and are then combined to form the larger program structure. Breaking a program up into methods reduces complexity, assists a developer to focus on individual parts of the program, and reduces the likelihood of program errors (called bugs).
Object Libraries
Over time, computer programmers discovered that new programs were often just a new combination of procedures that had been written for other situations. Rather than rewrite those steps every time they were needed, they saved those steps in a generic format (called an object) and grouped them together to form libraries. Examples of ready-made objects include all the Windows elements, like buttons, scroll bars, menus etc. Today, all computer languages come with large libraries of objects which you can use, and as you write your own programs, you will write your own objects.
WRITING PROGRAMS
Computers use binary numbers (composed of 0s and 1s) to manipulate data and perform actions. All computer programs are actually long lists of binary numbers, some of which represent data and others which represent instructions of what to do with that data.
In the early days of computing (around the 1940s), the first electronic computers used programs written by programmers in binary (also known as machine code). But writing in binary is very difficult for humans, and resulted in many errors and made programming an unreasonably slow process. To address these problems, Assembler was designed. Assembler is a second level language, which used a small set of keywords to represent the basic functions of a computer: inc for increment, dec for decrement, sto for store etc. While this was an improvement over writing machine code, it was still only for the truly dedicated programmer (who was often an electrical engineer with a strong understanding of the electronics involved). Still today, some highly experienced programmers may choose to write small pieces of very specialised programs in Assembler (or even binary), as it produces code which executes extremely fast.
IDE (Integrated Development Environment)
Once a programmer had written their program in Assembler, it would then need to be translated into binary (or machine code) for the computer to execute. So programs were written to do this translation – they are called compilers.
It is the same today, when you write your programs in Visual Basic .NET (a high level language), they will still need to be compiled with a compiler. Just as computers have become more complicated over the years, so have compilers. Modern compilers now form part of a collection of programming tools, contained within program development software, typically called an IDE (Integrated Development Environment). Your Microsoft Visual Basic .NET or Visual Studio.NET is an IDE. You will use this software to write and test your Visual Basic .NET programs. It includes many handy tools and access to the Visual Basic .NET Class Library.
Throughout this course we will provide directions on using some features of Visual Basic 2005, to get you started. A key skill in being a programmer is the willingness and patience to find “the missing bit of information”, as it is nearly impossible to readily know everything about programming and computers. With this in mind, while most of the directions we offer in this course will be identical in your IDE, there might be some small variation. If you are using a different IDE (i.e. not using Visual Basic 2005) and cannot locate the identical feature, button or command, with a little investigating you will find the equivalent one in your IDE.