From the course: Visual Basic Essential Training

Visual Basic and programming concepts - Visual Basic Tutorial

From the course: Visual Basic Essential Training

Start my 1-month free trial

Visual Basic and programming concepts

- [Instructor] The Microsoft Visual Basic programming language is a high level programming language for the Microsoft.NET framework. The Visual Basic language team follows design guidelines that make it an approachable and easy-to-learn language. The aim is to have code syntax that reads and writes like English sentences, and where possible, strive to make Visual Basic keywords and syntax structure promote the clarity and readability of Visual Basic code. That means, where possible, use meaningful words. It won't use acronyms, or abbreviations, or obtuse characters when a more readable approach is available. For example, here is a comparison with Visual Basic and another Microsoft language, C#. As you can see Visual Basic uses full names for datatypes like Boolean and Integer, while C# has abbreviated names like bool and int. Declaring a variable in Visual Basic reads like a sentence. Dim isReady as Boolean. Dim x as Integer = 5, whereas C# has a different and shorter syntax. And for comparisons, VB uses the traditional equals sign whereas C# uses the equal equal syntax. Here's a more complete example. Check out line 8 in the Visual Basic example. This is how to combine logical tests in an if statement. So you can see, it's using the equals sign for equality comparison, and then it's using several other logical operators, like x or, and, not. Now compare this with the syntax for C# on line 12, there are no readable words here, there's nothing but symbols. There is double ampersands, equal equal, the caret, and the exclamation point. Now let's talk about the language name. Names are important and there can be some confusion regarding what to call Visual Basic. Let's take a minute to talk about where VB originated. The original Visual Basic appeared in 1991. I'll call this era the Visual Basic Classic version. The original VB was a descendant of the popular BASIC language. It used the same code syntax as the BASIC language but added many improvements. What made it innovative in that era was its UI designer tools. The ability to quickly build a form from draggable controls. That's where the visible part of the Visual Basic name originated. It also made it easy to connect the VB controls on the form to the event driven code in the code file. By the end of the 90's Visual Basic was hugely popular and served a wide range of programmers, from amateur hobbyists to enterprise software departments. Microsoft knew that they needed to build a better programming platform for its newer operating system, and so it created the .NET framework. And of course, it wanted to modify Visual Basic to work with the new framework. To differentiate this new version from the existing VB, it was called Visual Basic .NET. This was the official name for the early years of .NET. Visual Basic classic is retired, so there's less need to differentiate the newer version. Nowadays, you rarely hear anyone say Visual Basic .NET, we simply call this newer version Visual Basic, or VB. While the goal is to make VB syntax easy to read, don't be fooled into thinking it's limited to simple apps. It's built on a platform of programming innovations that span decades. You're on a journey to learn how to code VB. Because of its long 30-year history, you'll find code concepts in VB that are part of many traditional programming languages. Much of your code will be written in a procedural fashion, within code blocks and functions. Visual Basic is fully object oriented, so you'll build and interact with objects and classes. In recent years, Microsoft has added functional programming features to .NET and modified Visual Basic to leverage some functional concepts. Visual Basic has full access to all the features of .NET, there is a fully staffed VB team at Microsoft working on new ideas too. Visual Basic is one of the principal languages for .NET, which means it has the same abilities as the other Microsoft languages, like C#, F#, and managed C++. You get the best of both worlds. Easy to read and write code, combined with the power of .NET.

Contents