Algorithm
An unambiguous, executable, and terminating specification of a way to solve a problem.
Abstraction
Breaking up a problem and hiding details to reduce the complexity of a task.
Accessor Method
A method that returns information but does not change the state of the program.
Ex: isMouseOver(), isGameOver(), frontIsClear(), countMyBeepers(), facingWest()
Binary
A number system consisting of 0 and 1.
Bit
Binary digit; the smallest unit of information, having two possible values: 0 and 1.
Block
A group of statements bracketed by {}.
Body
The body of a function is the code between the curly braces. For example:
void exampleFunction(int x)
{
// code
}
Byte
A number made up of eight bits. Essentially all currently manufactured computers use a byte as the smallest unit of storage in memory.
Camel Case
The preferred style of naming variables, where the first letter of every word after the first is capitalized. Ex: numBeepers, isAlive
Comment
An explanation to help the human reader understand a section of a program; ignored by the compiler. This has two forms.
// This is an inline comment. It works for a single line
/* This is an extended comment. It can go across
multiple lines, based on the starting and closing symbols */
Comparison Operator
An operator that compares integer values. These include: <, <=, >, >=, ==, and !=
Definite Loop
A loop that has a number of iterations set before the loop begins. Usually this is a for loop.
float
A data type that stores an floating. An floating point number is a positive or negative number that includes decimal values.
Ex: -3.6, 1.42, or 8.0
Function
A block of code that works toward a common purpose. Also known as methods.
Hard Coding
Writing a program in such a way that its data and parameters are fixed and cannot be altered without modifying the program. This is considered a bad practice.
Ex #1: In your Garden project, instead of using parameters to draw something the mouse position, if you made it always draw at a fixed location like 50, 80.
Ex #2: Making Karel follow an exact path to follow in a single specific maze, rather than teaching him how to navigate any maze.
Hard Drive
The part of a computer that stores things in long-term memory. This is typically slower than RAM, but has a larger storage capacity. This is where we store files and programs.
Header
The header of a function is the first line. This is also known as the signature. For example:
void exampleFunction(int x)
{
// code
}
Indefinite Loop
A loop that has an undetermined number of iterations when the loop begins. Usually this is a while loop.
int
A data type that stores an integer. An integer is a positive or negative whole number.
Ex: -3, 0, or 8
Logic Error
An error in a syntactically correct program that causes it to act differently from its specification.
Ex #1: My program runs, but when I click the meteor I get two points instead of one.
Ex #2: My program runs, but Karel crashes into a tree.
Logical Operator
An operator that can be applied to Boolean values. There are three core logical operators in Processing: AND (&&), OR (||), and NOT (!)
Method
A block of code that works toward a common purpose. Also known as functions.
Method Header
The top line of a method that includes a return type, name, and list of parameters.
Mutator Method
A method that changes the state of the program but does not return information.
Ex: move(), turnLeft(), putBeeper()
Modularity
A modular program is divided up into small parts with minimal ties between each part.
Ex: In Garden, we wrote drawFlower(float x, float y) to take a parameter where we draw a flower. This code is modular, because we could plug any value into x and y and the code would work. It is not dependent on specifics like mouse position.
Parameter
An item of information that is specified to a method when the method is called. Used to “pass” information. For example:
void exampleFunction(int x)
{
// code
}
Processing
A programming language developed in 2001 that is based on Java. It has a focus on ease of use, education, and visual design.
Organization
The structure of your program. Good organization for a program typically means:
Breaking your code up into smaller parts (functions)
Having code that is appropriately indented and spaces
Using comments to describe and label sections of code
RAM
RAM (Random Access Memory) is the part of a computer that stores things in short-term memory. This is typically faster than a Hard Drive, but has a smaller storage capacity. This is where a program stores things it is actively working on, such as variables in your program.
Return Type
The type of data returned by a method back to the code that called it. A method that does not return any information has a return type of void. For example:
void exampleFunction(int x)
{
// code
}
Reusability
Programmers highly value writing code that is reusable. Reusable code is typically strongly associated with code that has high modularity, and is written in a clear and easy to read fashion.
Statement
A syntactical unit in a program, usually referring to a single line of code.
Syntax
Rules that define how to form instructions in a particular programming language.
Syntax Error
A mistake in code that violates the rules of a language's syntax, preventing the code from compiling.
Ex: My program won't run because my curly braces are a mess.