Appendix A. Glossary

This appendix provides a glossary of key terms that you may encounter while studying Visual Basic programs.

accelerator

Underlined character, usually in a menu item, that activates that menu item when the user presses [Alt] plus the letter.

AcceptButton

Form property that determines the button triggered when the user presses [Enter].

accessibility

Determines which code is allowed to access subroutines, fields, properties, methods, and other class members. This can be Public, Private, Protected, Friend, or Protected Friend.

accessor

The Get and Set methods that allow a class to save and return a property's value.

Anchor

Property that enables a control to attach its left, right, top, and bottom edges to those of its container.

anonymous type

A data type that is automatically created by LINQ and never given a name for your code to use.

API

Application Programming Interface. A library of methods, classes, and other programming tools.

array

A group of values stored together in a single variable and accessed by index.

assembly

The smallest independent unit of compiled code. Typically, this is a Dynamic Link Library (DLL) or executable program.

assertion

A statement that the code claims is true. If the statement is false, the program stops running so you can decide whether a bug occurred.

backing field

A private field used to store the value of a property. The property's accessors get and set the backing field's value.

bit

A single binary digit. A bit can hold the value 0 or 1.

breakpoint

A marked piece of code that stops execution when running in the IDE.

bug

A programming error that makes a program fail to produce the correct result. A bug may make the program crash, produce an incorrect result, or perform the wrong action.

by reference

When you pass a parameter to a procedure by reference, Visual Basic passes the location of the value's memory into the procedure. If the procedure modifies the parameter, the value is changed in the calling code as well. Use the ByRef keyword to pass a value by reference.

by value

When you pass a parameter by value, Visual Basic makes a copy of the value and passes the copy to the procedure. Changes that the procedure makes to the value do not affect the value in the calling code. Use the ByVal keyword to pass a value by value.

Byte

Eight bits. When considered as an unsigned integer, a byte can hold values between 0 and 255. When considered as a signed integer, a byte can hold values between −127 and 128.

CAD

See computer aided design.

camel casing

A naming convention whereby multiple words are strung together with the first letter of each word except the first capitalized, as in firstName or numberOfEmployees.

CancelButton

Form property that determines the button triggered when the user presses [Esc].

catch

When an exception occurs, a program can catch the exception to take control and perform some remedial action (or just tell the user that something's wrong). When an object raises an event, the program can catch the event and take action.

class

Defines a data type with properties, methods, events, and other code encapsulated in a package. After you define a class, you can make as many instances of that class as you like. Very similar to a structure except classes are reference types, whereas structures are value types.

code module

A code file that is not associated with any form or other class.

Comment

Text within the program that is not executed by the program. Use comments to make the code easier to understand.

Component

A programming entity similar to a control except it has only code and doesn't have a visible appearance on the screen. You still place it on a form at design time, however, and the program's code can interact with it. Some components such as ErrorProvider and ToolTip may display visible effects on the screen.

Component Tray

The area below the form where components sit at design time.

compound assignment operators

Operators such as += and &= that combine a variable's current value with a new value.

computer aided design (CAD)

A program that helps the user design something, often something graphical such as an architectural drawing or an electronic circuit. Many CAD systems do more than just draw. For example, they may produce lists of materials, validate electronic circuits, or calculate physical properties of the system designed.

concatenate

To join two strings together.

conditional operator

The AndAlso and OrElse operators, which evaluate their second operands only if necessary.

constant

Similar to a variable, but you must assign it a value when you declare it and you cannot change the value later. You can use constants to make your code easier to read.

constructor

A method that executes when an object is created.

control

A programming entity that combines a visible appearance on the screen with code that defines its appearance and behavior.

Coordinated Universal Time (UTC)

Basically, Greenwich Mean Time (GMT), the time at the Royal Observatory in Greenwich, London. (See en.wikipedia.org/wiki/Coordinated_Universal_Time for details and history.)

data type

A particular kind of data such as Integer, String, Date, or TextBox. All variables must have a data type.

default constructor

The parameterless constructor that is created by default when you create a class.

deferred execution

When a program delays performing some task until a later time. LINQ uses deferred execution when it delays performing a query until the results of the query are actually needed.

derive

To make one class inherit from another.

design time

The stage of development when you are editing a program in Visual Studio. During this time, you use the Form Designer, Code Editor, Properties window, and other IDE features to build the program. Contrast this with run time.

DialogResult

The result returned by a dialog to tell the calling code which button was clicked. Also a Button property that determines the DialogResult the button sets for the form.

Dock

Property that enables a control to fill the left, right, top, bottom, or remaining area of its container.

dominant control

When you select a group of controls in the Form Designer, one is marked as the dominant control. Arranging tools use this control to determine how the controls are displayed. For example, the Format

Glossary
drag source

An object that initiates a drag-and-drop operation.

drop target

An object that is a candidate to receive data dropped in a drag-and-drop operation.

edit-and-continue

A debugger feature that enables you to modify a stopped program's code and continue running without stopping and restarting the program.

empty constructor

A parameterless constructor.

encapsulation

Detail hiding. A class hides its internal details so the rest of the program doesn't need to understand how they work, just how to use them.

enumerated type

See enumeration.

enumeration

A data type that can take one of a list of specific values.

Euclid's algorithm

Also called the Euclidean algorithm. An efficient algorithm for finding the greatest common divisor (GCD) of two numbers.

event

An object raises an event to tell the program that something interesting has occurred. The program can catch the event to take action.

event handler

An event handler catches an event and takes appropriate action.

exception

Object that represents some kind of error such as an attempt to divide by zero or an attempt to parse a string that has an invalid format.

factorial

The factorial of a number N is written N! and equals 1 * 2 * 3 * ... * N.

Fibonacci number

The Nth Fibonacci number Fib(N) is defined recursively by Fib(0) = 0, Fib(1) = 1, and Fib(N) = Fib(N – 1) + Fib(N – 2).

field

A variable defined in a class or structure that's not inside any method so it is visible throughout the class or structure.

function

A packaged set of code that other pieces of code can invoke and that returns a result value. See procedure.

GDI

Graphics Device Interface. A library of methods for rendering graphics in Windows used by Windows Forms controls.

GDI+

The .NET version of GDI.

generic class

A class that takes as a parameter one or more data types that it uses to work more closely with those data types. See Lesson 30 for information about generic classes.

generic constraint

A constraint on the types passed to a generic class, such as requiring the type to have a parameterless constructor or requiring that it implement the IComparable interface.

gigabyte (GB)

1,024 megabytes.

globalization

The process of building an application for users from different cultures.

greatest common divisor (GCD)

The largest integer that evenly divides two other integers.

IDE

See integrated development environment.

Index

A value that selects an item from a group. For example, in an array, the index is an integer between 0 and one less than the number of elements in the array used to identify a specific item in the array.

instance

An instance of a class is an object of the class's type. Different instances of the same class have the same properties, methods, and events but they may have different property values.

integrated development environment (IDE)

An environment for building, testing, and debugging programs, such as Visual Studio.

interface

Defines public properties, methods, and events that a class must provide to satisfy the interface.

kilobyte (KB)

1,024 bytes.

LINQ

Language Integrated Query. A set of extensions provided by the .NET Framework that allows Visual Basic code to query and select data from data sources such as arrays and lists.

locale

A setting that defines the user's language, country, and cultural settings, which determine such things as how dates and monetary values are formatted and parsed.

localization

The process of customizing a globalized application for a specific culture.

lower bound

An array's smallest index (always 0 in Visual Basic).

machine language

A low-level language that gives instructions directly to the computer's central processing unit to perform tasks on the machine's hardware. Machine language is much harder for humans to read and understand than a higher-level programming language such as Visual Basic.

magic number

A value hard-coded into a program that is difficult to remember. To make code clearer, use constants such as taxRate instead of magic numbers such as 0.09D.

megabyte (MB)

1,024 kilobytes.

Method

A procedure implemented by a class. See procedure.

method scope

A variable that is declared inside a method and not inside any other code block has method scope. It is visible to all of the following code within that method.

Modal

When a program displays a modal form, the user cannot interact with any other part of the application until closing that form. Dialogs are generally modal. A form's ShowDialog method displays the form modally.

modeless

When a program displays a modeless form, the user can interact with other parts of the application while the modeless form is still visible. A form's Show method displays a modeless form.

Me

A special object reference that means "the object that is currently executing this code."

My

A namespace containing properties and methods shortcuts that make it easier to access commonly needed tools.

namespace

A classification of classes with a common purpose. Use Imports directives at the top of a code file to tell Visual Basic which namespaces to search for classes that the code uses.

narrowing conversion

A conversion from a "wide" data type such as Single to a "narrower" data type such as Integer. Some precision may be lost in a narrowing conversion.

nibble

Half a byte (4 bits).

NumberStyles.Any

Passed as a second parameter to Decimal.Parse, this allows that method to correctly interpret values formatted as currency.

object-relational mapper (ORM)

A tool that maps between pieces of data in a relational database and objects in a program.

operator overloading

Defining a new meaning for an operator such as + or * when working with arguments of specific data types.

order by clause

A clause in a LINQ query that orders the returned data.

ORM

See object-relational mapper.

overloading

Giving a class more than one method with the same name but different parameter lists.

overriding

Replacing a parent class method with a new version.

parameterless constructor

A constructor that takes no parameters.

parse

To try to find structure and meaning in text.

Pascal casing

A naming convention whereby multiple words are strung together with the first letter of each word capitalized, as in TextBox and ProgressBar.

pixel

A single point on the screen or in an image. The word pixel comes from "picture element."

polymorphism

The ability to treat an object as if it were an instance of an ancestor class. For example, if Employee inherits from Person, then a method that takes a Person as a parameter can also take an Employee as a parameter.

precedence

The order in which operators are applied in an equation.

precision specifier

Part of a formatting string passed to String.Format that affects the way a formatting character works. For example, the 10 in the format D10 formats an integer value with digits only (no thousands separators), padded on the left with zeros if necessary so it is 10 digits long.

procedure

A packaged set of code that other pieces of code can invoke. Types of procedures include subroutines, functions, methods, and property procedures.

programming language

A language used by developers to build programs. Contrast this with machine language, which is at a much lower level intended for use by the computer.

projecting LINQ query

A LINQ query that uses a select clause to return data other than the values over which the query ranges.

property procedure

A Get or Set procedure used to implement a property for a class. See procedure.

queue

A list that lets you add items at the front and remove them from the back. Also called a FIFO list or FIFO. (FIFO stands for first-in-first-out.)

raise

An object raises an event to tell the program that something interesting occurred.

range variable

The variable that a LINQ query uses to range over the data in the data source.

recursion

The process of a method calling itself.

recursive method

A method that calls itself.

refactoring

Restructuring a program to make it more reliable, easier to read, or easier to maintain without changing its outward behavior.

reference type

A data type such as a class reference that refers to an item instead of holding the item itself. Variables referring to class instances are reference variables. Contrast this with a value type.

relatively prime

Two numbers are relatively prime if their greatest common divisor is 1.

run time

The time when the program is running. Contrast this with design time.

scope

A variable's scope is the code that can "see" or access the variable.

select clause

A clause in a LINQ query that determines what data is returned for the selected data.

shared method

A method that is provided by the class itself, rather than an instance of the class. You invoke it as in ClassName.MethodName().

short-circuit operator

See conditional operator.

shortcut

Key combination such as [Ctrl]+S or [Ctrl]+N that immediately activates a menu command.

side effects

Consequences that last after a method has finished. Side effects make code harder to understand and debug, so you should try to avoid writing methods with non-obvious side effects.

splitter

An area that you can click and drag to adjust the sizes of the areas on either side of the splitter.

stack

A list that lets you add items at the top and remove them from the bottom. Also called a LIFO list or LIFO. (LIFO stands for last-in-first-out.)

stream

An ordered series of bytes, sometimes representing a file.

strong type checking

Requiring values to have specific data types such as Person or String instead of more general types such as Object.

structure

Defines a data type with properties, methods, events, and other code encapsulated in a package. After you define a structure, you can make as many instances of that structure as you like. Very similar to a class except classes are reference types, whereas structures are value types.

sub procedure

See subroutine.

subroutine

A packaged set of code that other pieces of code can invoke that does not return a value. See procedure.

terabyte (TB)

1,024 gigabytes.

throw

A program throws an exception to indicate that something bad has happened that it cannot handle. Other code higher up in the call stack can catch the exception and take action.

transforming LINQ query

See projecting LINQ query.

upper bound

An array's largest index. Because Visual Basic arrays start with lower bound 0, the upper bound (for one-dimensional arrays) is one less than the array's length.

value type

A data type that holds its data, not a reference to it. Primitive data types such as Integer and Single, as well as structures, are value types. Contrast this with a reference type.

Variable

A named piece of memory that can hold a piece of data.

Visual Basic

A general-purpose, high-level programming language. It is one of the programming languages that can run in the powerful Visual Studio integrated development environment (IDE).

Visual Studio

A development environment for building programs in several programming languages, including Visual C#, Visual Basic, Visual C++, and F#. Home page: msdn.microsoft.com/vstudio.

where clause

A clause in a LINQ query that filters the data to return only selected items.

widening conversion

A conversion from a "thin" data type such as Integer to a "wider" data type such as Single. No precision is lost in a widening conversion

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset