ArticleslgStudy

science

Comparison of Visual Basic and Visual Basic .NET

Comparison of Visual Basic and Visual Basic .NET is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Comparison of Visual Basic and Visual Basic .NET rather than just read about it. In short: Visual Basic .NET was released by Microsoft in 2002 as a successor to the original Visual Basic computer programming language. It was implemented on the .NET Framework 1.0.

Key takeaways

  • Comparison of Visual Basic and Visual Basic .NET belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Comparison of Visual Basic and Visual Basic .NET to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Comparison of Visual Basic and Visual Basic .NET from memory before moving on to harder problems.

Reference excerpt

Visual Basic .NET was released by Microsoft in 2002 as a successor to the original Visual Basic computer programming language. It was implemented on the .NET Framework 1.0. The main new feature was managed code. Programmers familiar only with Visual Basic would probably have encountered difficulties working with the new version or adapting existing programs for it.

Obvious major differences The new platform bore little resemblance to its predecessor. While programmers expected to be able to recompile their Visual Basic source to a .NET target, the reality of the situation was that Visual Basic .NET was a vastly different paradigm. Obvious syntax differences aside, Visual Basic .NET provides much the same functionality as C# (since they both compile down to MSIL, with the most obvious difference being the case insensitivity of Visual Basic .NET, maintaining the original case-insensitivity of Visual Basic), which is more of a problem for C# programmers trying to inter-operate with Visual Basic .NET developers than anything else. The basic syntax remains very similar: conditions, loops, procedures, sub-routines are declared and written in the same manner (see Visual Basic). Mobility from prior Visual Basic iterations to Visual Basic .NET really are parts of existing code: programmers with experience in both worlds are required to effectively target the new platform with older logic. The Visual Basic .NET developer will have to learn the use of the basic .NET types rather than what they have been used to in Visual Basic. A programmer who has only worked with Visual Basic may encounter a steep learning curve to migrate to Visual Basic .NET. A programmer who is versed in another language or who has had exposure to the .NET runtime should be able to cope. It would be better to think of Visual Basic .NET as a new language inspired by the classic Visual Basic rather than as a continuation of Visual Basic 6.0, with the added difficulty for migrating programmers that VB.NET interfaces with the .NET Framework whereas VB6 was based on the Component Object Model (COM).

More detailed comparison There are some immediate changes that developers should take note of:

More C-like syntax Visual Basic .NET allows for the +=, -=, *=, /=, \=, ^=, and &= compound operators so that longer lines like:

can now be written as:

However, increment and decrement operators are not supported.

Short-circuited logic In prior iterations of Visual Basic, all statements in a condition would have been evaluated even if the outcome of the condition could be determined before evaluating a condition. For example:

This was not only inefficient, but could lead to unexpected results for any person used to another language. In Visual Basic .NET, the new AndAlso and OrElse operators have been added to provide short-circuit evaluation like many other languages.

Explicit pointer-like types are no more Var* variable types are deprecated in Visual Basic .NET. The common runtime decides which types are reference types and which types are value types so this is no longer the domain of the programmer.

Properties: Let and Set Class properties no longer require the Let and Set statements

Debug printing Debug.Print is replaced with Debug.Write and Debug.WriteLine

Procedures A procedure call must have parentheses in Visual Basic .NET. Visual Basic .NET requires a ByVal or ByRef specification for parameters. In Visual Basic the specification could be omitted, implying ByRef by default. Most development environments, such as Visual Studio .NET, will automatically insert a ByVal, so in effect the default is ByVal, not ByRef. There are tools to convert Visual Basic code to VB.NET, such as the Visual Basic Upgrade Wizard that was included in Visual Studio .NET 2002 and 2003. Conversion tools automatically insert a ByRef if necessary, preserving the semantics of the Visual Basic application.

Zero-based arrays Visual Basic 5.0 and 6.0 has traditionally employed zero-based arrays (the default lower bound), unless "Option Base 1" is declared. This was the source of many out-by-one errors in Visual Basic programs, especially when dealing with interoperability across program library boundaries. Although the .NET Common Language Runtime can support arrays with any base value, Visual Basic .NET and C# provide only zero-based arrays and lists, and the .NET Common Language Specification requires zero-based arrays for interoperability between .NET languages.

Jagged Arrays Visual Basic .NET introduced the concept of a jagged array, whereby the rows can have unequal length as opposed to the uniform length of arrays imposed on Visual Basic programmers.

Variant data type is gone In languages compiling down to .NET platform, types are strict. Whilst the runtime allows for anonymous object which don't have a pre-defined, named type, the type of a variable may not change over the course of its life-time, hence the need to drop the Variant data-type. However, type "Object" has somewhat similar behavior in practice.

True object-oriented programming Visual Basic was an object-based language. It supported classes, but not other concepts that would make it an object-oriented language. Visual Basic .NET is a true object-oriented language with the following features:

inheritance function overloading Although no language targeting .NET allows for multiple inheritance for classes—multiple inheritance of interfaces is supported.

Change from COM to NET Whilst the IDE does a reasonable job of hiding the fact, the dependence on ActiveX objects is dropped in Visual Basic .NET (although there are mechanisms for interfacing with COM in .NET ) in favour of .NET components offering similar functionality. This shift is good for the Visual Basic developer since much of the performance issues in Visual Basic arose around the cost of the COM interface.

Elementary geometry management via the Forms designer One of the true banes of a Visual Basic developer's life has always been writing resize code. Whilst the WinForms paradigm leaves a lot to be desired in the geometry management department in the face of toolkits like Qt and GTK+, at least the developer can anchor widgets on forms instead of having to write reams of code in OnResize handlers.

Option Explicit by default In Visual Basic .NET, Option Explicit is on by default.

References

External links The top 5 changes between VB 6 and VB.NET Archived 2011-10-16 at the Wayback Machine Jagged Arrays in VB.NET

Worked examples

Example 1 — a first encounter with Comparison of Visual Basic and Visual Basic .NET

Start with the simplest possible case. Write down what Comparison of Visual Basic and Visual Basic .NET claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Comparison of Visual Basic and Visual Basic .NET before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Comparison of Visual Basic and Visual Basic .NET ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Comparison of Visual Basic and Visual Basic .NET

In research
Comparison of Visual Basic and Visual Basic .NET appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Comparison of Visual Basic and Visual Basic .NET in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Comparison of Visual Basic and Visual Basic .NET is common in secondary-school and first-year university syllabi. It links to neighbouring topics .NET, BASIC programming language, BASIC programming language family, so understanding it makes those chapters shorter.
In everyday life
Look for Comparison of Visual Basic and Visual Basic .NET outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Comparison of Visual Basic and Visual Basic .NET” →

How to study Comparison of Visual Basic and Visual Basic .NET in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Comparison of Visual Basic and Visual Basic .NET means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Comparison of Visual Basic and Visual Basic .NET out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Comparison of Visual Basic and Visual Basic .NET in simple terms?

Visual Basic .NET was released by Microsoft in 2002 as a successor to the original Visual Basic computer programming language. It was implemented on the .NET Framework 1.0.

Why does Comparison of Visual Basic and Visual Basic .NET matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Comparison of Visual Basic and Visual Basic .NET?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Comparison of Visual Basic and Visual Basic .NET.

Tags

  • .NET
  • BASIC programming language
  • BASIC programming language family
  • Comparison of individual programming languages

Keep exploring