A collection of important terms and definitions involved in the art and science of computer programming. Includes nuances of C++, Java, Visual Basic, and C#. A work in progress, it will be updated periodically.
2. Algorithm
• A finite sequence of unambiguous
instructions which, when given the
required input, produces the correct
output and then stops.
• A sequence of the correct steps in the
correct order for solving a problem.
- Michael Henson -
www.michaeljhenson.info
3. Pseudocode
• An algorithm written in plain English
instructions and structured into a
code-like form.
• An intermediate step between natural
language and programming language.
- Michael Henson -
www.michaeljhenson.info
4. IDE
• Integrated Development Environment
• A set of software tools that work
together for designing, developing,
and troubleshooting programs.
• Usually includes a source code editor,
debugger, compiler, project management
features, and often much more.
- Michael Henson -
www.michaeljhenson.info
5. Variable
• A value stored in the computer’s
memory.
• All variables have:
– Name (how we reference it in code)
– Type (what type of data it stores)
– Value (what actual data value it has)
– Size (how many bits in memory)
- Michael Henson -
www.michaeljhenson.info
6. Precedence
• The priority of operators that
determines the order in which they
are evaluated.
• Higher precedence goes first.
• The precedence of operators in Java, C+
+, C#, and Visual Basic follows the same
mathematical rules as standard arithmetic.
- Michael Henson -
www.michaeljhenson.info
7. Control Structures
• Also called control statements.
• Code statements that determine how
control is transferred from one statement
to another.
• In structured programming, there are three
types:
1. Sequence – the steps go in the given order
2. Selection – branching; conditional “if” statements
3. Repetition – looping
- Michael Henson -
www.michaeljhenson.info
8. Selection Structures
• Control structures that evaluate a
condition to determine which
statement will be executed next.
• Also called branching statements or
conditional statements.
• Java, C++, C#: if, if/else, switch
• Visual Basic: If-Then, If-Then/Else,
Select Case
- Michael Henson -
www.michaeljhenson.info
9. Repetition Structures
• Loops -- control structures that evaluate a
condition to determine whether to repeat
a given block of code.
• In Java and C++: while, do/while, for
• In C#: All of the above, plus foreach
• In Visual Basic .NET: While, Do
While/Loop, Do/Loop While, Do
Until/Loop, Do/Loop Until, For/Next,
For Each/Next
- Michael Henson -
www.michaeljhenson.info
10. GUI
• Graphical User Interface
• An interface to a software program
consisting of visual, graphical
elements with which the user
interacts.
- Michael Henson -
www.michaeljhenson.info
11. Function
• A subroutine that returns a value
back to the caller.
• In C++, subroutines are sometimes called
functions even when they do not return a
value (void functions).
- Michael Henson -
www.michaeljhenson.info
12. Sub
• In Visual Basic, a procedure that
does not return a value to the
caller.
• In C++, we call this a void function.
• In Java, we call this a void method.
- Michael Henson -
www.michaeljhenson.info
13. Method
• A subroutine that is defined as a
member of a class.
• In C++, these are usually called member
functions.
• In Java, every subroutine is called a
method since they all must exist within the
bounds of a class.
- Michael Henson -
www.michaeljhenson.info
14. Parameters
• Values passed as input into a
procedure from the point where the
procedure is called. (Actual
parameters or arguments.)
• Variables declared in a procedure
header to hold values that are
passed in. (Formal parameters.)
- Michael Henson -
www.michaeljhenson.info
15. Signature
• The portion of a procedure header
containing the procedure’s name
and parameter list.
• Each procedure must have a unique
signature. That is, they must differ either
in name or in the number, type, or order of
their parameters.
- Michael Henson -
www.michaeljhenson.info
16. Pass by Value
• A way of passing parameters in
which a copy of the parameter’s
value is passed to the procedure.
• In Java, primitive variables are always
passed by value.
• In C++, this is the default behavior of
parameters unless otherwise specified.
• In VB, this is accomplished using ByVal.
- Michael Henson -
www.michaeljhenson.info
17. Pass by Reference
• A way of passing parameters in
which a reference to the original
variable is passed to the procedure.
• Objects are always passed by reference.
• In C++, primitive variables can be passed
as reference parameters by using &.
• In VB, this is accomplished using ByRef.
- Michael Henson -
www.michaeljhenson.info
18. Scope
• The portion of program code where
a particular identifier (variable,
function, etc.) may be referenced.
- Michael Henson -
www.michaeljhenson.info
19. Overloading
• Creating multiple procedures with
the same name but different
parameter lists.
- Michael Henson -
www.michaeljhenson.info
20. Data Structure
• A collection of memory locations
under one name that stores multiple
pieces of data.
• May be static (fixed size) or dynamic (can
grow and shrink).
- Michael Henson -
www.michaeljhenson.info
21. Array
• A static data structure in which the
elements, all of which are the same
data type, are accessed via the
array name and an integer
subscript.
• All elements of an array have the same
name and type.
- Michael Henson -
www.michaeljhenson.info
22. Sorting
• The process of putting a data
structure’s elements in order.
- Michael Henson -
www.michaeljhenson.info
23. Searching
• The process of looking through a
data structure to find a given key
value.
- Michael Henson -
www.michaeljhenson.info
24. Encapsulation
• Encapsulation is the bundling of data
with the program code that operates on it.
• Objects do this by containing data
members and methods in their class
definitions.
• Encapsulation enables information hiding.
- Michael Henson -
www.michaeljhenson.info
25. Information Hiding
• Information hiding is the ability to hide
implementation details from the outside
world. It enables objects to make things
available on a “need-to-know” basis and
helps to protect data from taking on invalid
values.
• Objects do this by containing data and
methods that are marked public, private,
or some level in between.
- Michael Henson -
www.michaeljhenson.info
26. Constructor
• A special method that is called
automatically upon the creation of
an object to initialize that object’s
data and prepare it for use.
• In Java, C++, and C#, the constructor
always has the same name as the class it
constructs.
• In VB, the constructor is always Sub New.
- Michael Henson -
www.michaeljhenson.info
27. Accessor
• A procedure for accessing an
object’s private data.
• Sometimes called getters (for retrieving
values) and setters (for setting values).
• In VB and C#, get and set accessors can
be paired in Property methods.
- Michael Henson -
www.michaeljhenson.info
28. Class
• The definition of a certain type of object
or group of objects. A class defines what is
required for a certain object to exist.
• Declares the properties that describe an object
and the behaviors of which an object is capable.
• An object-oriented program is made of class
definitions which declare variables that
represent an object’s attributes (data members)
and the functions that determine an object’s
behaviors (methods).
- Michael Henson -
www.michaeljhenson.info
29. Object
• An object is a “thing” that has attributes
and behaviors. It’s an instance of a
class.
• A common analogy: If a class is the
blueprint for a house, then an object is the
actual house that was built from the
blueprint.
- Michael Henson -
www.michaeljhenson.info
30. Composition
• A relationship between objects in
which one object is composed of
another object.
• For this reason, composition is sometimes
called “aggregation” or a “has-a”
relationship.
• Classes do this by containing object
variables as data members.
- Michael Henson -
www.michaeljhenson.info
31. Inheritance
• A relationship between classes in
which one class automatically
absorbs all of the properties and
behaviors of another class.
• Inheritance creates an “is-a”
relationship between the child and
parent classes.
- Michael Henson -
www.michaeljhenson.info
32. Overriding
• Overriding happens when a class
inherits a method from its parent
and then replaces that method with
an alternate implementation of it.
• Overriding can be thought of as
“redefining”
- Michael Henson -
www.michaeljhenson.info
33. Access Modifier
• A keyword that specifies which
parts of the code have access to a
particular class member.
• See language-specific modifiers on
following slides.
- Michael Henson -
www.michaeljhenson.info
34. VB Access Modifiers
Modifier: Allows access to:
Public Anyone who has an
object of the class
Protected Subclasses
Friend Other classes in the
same assembly
Private Code within the same
class only
- Michael Henson -
www.michaeljhenson.info
35. C# Access Modifiers
Modifier: Allows access to:
public Anyone who has an
object of the class
protected Subclasses
internal Other classes in the
same assembly
private Code within the same
class only
- Michael Henson -
www.michaeljhenson.info
36. Java Access Modifiers
Modifier: Allows access to:
public Anyone who has an
object of the class
(default package
access)
Subclasses and classes
in the same package
protected Subclasses
private Code within the same
class only- Michael Henson -
www.michaeljhenson.info
37. C++ Access Modifiers
Modifier: Allows access to:
public Anyone who has an
object of the class
protected Subclasses
private Code within the same
class only
- Michael Henson -
www.michaeljhenson.info
38. Polymorphism
• The ability of different types of
objects related by inheritance to
respond differently to the same
method call.
• This is made possible by the fact that
classes inherit methods from their parents
and can then override those methods.
- Michael Henson -
www.michaeljhenson.info
39. Abstract Class
• An “incomplete” class; one that
cannot be instantiated; one that
usually contains abstract methods
and is intended to be used as a
base class only.
• Abstract classes are one way of inheriting
an interface without necessarily inheriting
a specific implementation.
- Michael Henson -
www.michaeljhenson.info
40. Abstract Method
• A method that is only declared, but
left undefined.
• An abstract method is intended to be
overridden in subclasses.
• In C++, abstract methods are called pure
virtual functions.
- Michael Henson -
www.michaeljhenson.info