You are on page 1of 6

VB.

NET  It is an object-oriented
Visual Basic .NET (VB.NET) is an object- programming language. It treats
oriented computer programming language everything as an object.
implemented on the .NET Framework.  Automatic code formatting, XML
designer, improved object browser
etc.
Although it is an evolution of classic Visual  Garbage collection is automated.
Basic language, it is not backwards-  Support for Boolean conditions for
compatible with VB6, and any code written decision making.
in the old version does not compile under  Simple multithreading, allowing
VB.NET your apps to deal with multiple tasks
simultaneously.
 Simple generics
Everything in VB.NET is an object, including
 A standard library
all of the primitive types (Short, Integer,
Long, String, Boolean, etc.) and user defined  Events management
types, events, and even assemblies. All  References. You should reference an
objects inherit from the base class Object. external object that is to be used in
a VB.NET application.
 Attributes, which are tags for
VB.NET is implemented by Microsoft's .NET providing additional information
framework. Therefore, it has full access to regarding elements that have been
all the libraries in the .Net Framework. It's defined within a program.
also possible to run VB.NET programs on  Windows Forms - you can inherit
Mono, the open-source alternative to .NET, your form from an already existing
not only under Windows, but even Linux or form.
Mac OSX.

Strengths of VB.Net
VB.Net programming is very much based on
 Your code will be formatted
BASIC and Visual Basic programming
automatically.
languages, so if you have basic
 You will use object-oriented
understanding on these programming
constructs to create an enterprise
languages, then it will be a fun for you to
class code.
learn VB.Net programming language.
 You can create web applications
with modern features like
VB. Net Features performance counters, event logs,
and file system.
 VB.NET is not case sensitive like
 You can create your web forms with
other languages such as C++ and
much ease through the visual forms
Java.
designer. You will also enjoy drag
and drop capability to replace any VB. NET Anatomy
elements that you may need. Imports System
 You can connect your applications to
other applications created in  It is used to include the System
languages that run on the .NET namespace in the program.
framework.
 You will enjoy features like docking, Module
automatic control anchoring, and  declaration of module Module1.
in-place menu editor all good for Every program requires a class
developing web applications. module for data and procedures.

Weaknesses of VB.Net VB. Net Single-Line Comment


 VB.NET cannot handle pointers  Apostrophe (‘)
directly. This is a significant  REM (Remarks)
disadvantage since pointers are
much necessary for programming. Main or Main Procedure
Any additional coding will lead to
many CPU cycles, requiring more  It states what the module or class
processing time. Your application will do when executed.
will become slow.
WriteLine or Console.WriteLine
 VB.NET is easy to learn. This has led
 It is a method of the Console class
to a large talent pool. Hence, it may
defined in the System namespace.
be challenging to secure a job as a
This statement causes the message
VB.NET programmer
"Hello, World!" to be displayed on
the screen.
VB Net Environments
Integrated Development Environment (IDE) Console.ReadKey()
 Visual Studio (VS)  It is for the VS.NET users, which
 Visual Studio Express (VSE) prevents the screen from running
 Rider and closing quickly when the
 Mono program is launched from Visual
Online Compilers Studio .NET.

 Tutorialspoint
 OneCompiler
 JDoodle
 GDB Online Debugger
Data Types Variable Naming Rules
Data Type Storage Allocation  You must use a letter as the first
Boolean It depends on character.
implementing  You can't use a space, period (.),
platform exclamation mark (!), or the
Byte 1 byte characters @, &, $, # in the name.
Char 2 bytes  Name can't exceed 255 characters in
Date 8 bytes length.
Decimal 16 bytes
 Generally, you shouldn't use any
Double 8 bytes
names that are the same as the
Integer 4 bytes
function, statement, method, and
Long 8 bytes
intrinsic constant names used in
Object 4 bytes (32 bit)
8 bytes (64 bit) Visual Basic or by the host
SByte 1 byte application
Short 2 bytes  You can't repeat names within the
Single 4 bytes same level of scope.
String It depends on
implementing
platform Console.ReadLine()
UShort 2 bytes  It will read the console input from
UInteger 4 bytes the user, up until the next newline is
ULong 8 bytes detected (usually upon pressing the
User-defined It depends on Enter or Return key).
implementing  Code execution is paused in the
platform current thread until a newline is
provided. Afterwards, the next line
Variables of code will be executed.
 A name given to a storage area that
our programs can manipulate. Constants
 Refer to fixed values that the
 Each variable in VB.Net has specific program may not alter during its
type, which determine the size and execution.
layout of the variable's memory.  Can be of any of the basic data type.
 Treated just like regular variables
 The Dim statement is used for except that their values cannot be
variable declaration and storage modified after their definition
allocation for one or more variables.  An enumeration is a set of named
integer constants. (Enum nameVar)
 Dim myVariable As DataType  Const myVariablel As DataType
declaration context, including from
Modifiers within any contained types.

 The modifiers are keywords added Selection Control Structure


with any programming element to  It requires that the programmer
give some especial emphasis on specify one or more conditions to
how the programming element will be evaluated or tested by the
behave or will be accessed in the program.
program.  Statements will execute if the
 For example, the access modifiers: condition is determined to be true,
Public, Private, Protected, Friend, and optionally, other statements to
Protected Friend, etc., indicate the be executed if the condition is
access level of a programming determined to be false
element like a variable, constant,  If Then, If Then Else, Select Case
enumeration or a class.

Repetition Control Structure


VB.Net Modifiers  Also known as Loop.
Public  A loop statement allows us to
 Specifies that one or more declared execute a statement or group of
programming elements have no statements multiple times.
access restrictions.  Do While, While, For Next, For Next
with Increment.

Protected
Array
 Specifies that one or more declared
programming elements are  It is used to store a collection of
accessible only from within their data, but it is often more useful to
own class or from a derived class. think of an array as a collection of
variables of the same type.
 All arrays consist of contiguous
Default
memory locations. The lowest
 Identifies a property as the default address corresponds to the first
property of its class, structure, or element and the highest address to
interface. the last element.

Private
User Defined Functions
 Specifies that one or more declared
Functions are group of statements that
programming elements are
together perform a task when called. After
accessible only from within their
the procedure is executed, the control
returns to the statement calling the Round()
procedure.  Rounds a number to the nearest
integer.
Built In Functions
LCase() Floor()
 Returns a string or character  the largest integer that's less than or
converted to lowercase. equal to the specified Decimal or
Double number.
UCase()
 Returns a string or character
containing the specified string
converted to uppercase.

Trim()
 Returns a string containing a copy of
a specified string with no leading or
trailing spaces.

Len()
 Returns an integer that contains the
number of characters in a string.

FormatPercent()
 Returns an expression formatted as
a percentage (that is, multiplied by
100) with a trailing % character.

Abs()
 Returns the absolute value of a
number.

Sqrt()
 Returns the square root of a
number.

You might also like