macdevcenter.com
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button

Glossary for "Loop the Loop"

by Seth Roby
09/09/2003
Argument

The bits of data that are given to a function to work with (it's input). During the function call, they are listed inside the parentheses. During the function definition, they are defined with types and names inside the parentheses.

Argument Passing

The term used for giving values to the arguments in a function you are calling. Expressions are always evaluated before being passed as arguments. For example, in:

myFunction(3+2, "Simon");

The arguments are being passed as 5 and the string "Simon".

Assignment Operator

The equals sign, one example of an operator. This takes everything to the operator's right until a semicolon, evaluates it, and sets the variable that is to the immediate left of the operator to that value.

Binary Operator

An operator that works with two operands, one on each side of it.

Bit

a one or a zero. A group of eight is a byte

Block

A section of code between an opening curly brace '{' and a closing curly brace '}'. These can nest, so you can have a block inside another block. In general, a block can replace any line of code.

Boolean And

The binary operator '&&', which evaluates to TRUE if and only if both the conditions on either side of it evaluate to TRUE.

Boolean Or

The binary operator '||', which evaluates to TRUE if either of the conditions on either side of it evaluate to TRUE, or if both evaluate to TRUE.

Boolean Logic

The branch of logic that determines if statements are TRUE or FALSE. This duality of yes and no is very computer-savvy, being binary (only two values).

Boolean Value

TRUE or FALSE, YES or NO.

Build

The name that the developer tools give to compiling code.

Byte

a group of eight bits

C String

A type of string that is used often by C.

Character

A type that represents one letter, number, or symbol that can be written with a keystroke.

Comment

In code, a part that is meant to be read only by humans, and not to have meaning to the compiler. Like whitespace, the compiler simply ignores comments, which lets you put anything you want in them.

Comparison Operator

A binary operator that compares its operands and evaluates to a boolean value.

Compile

Translating the code you wrote in a half-english, half-computerese code into full computerese, called 'machine code' that the computer understands and can run.

Compiler

A program on the computer that translates your code into machine language. Does the compiling.

Compile Time

The time when the compiler is translating the code to machine language so that it can be run.

Compound Condition

A set of conditions joined by logical operators such as 'and', and 'or'.

Condition

In a conditional, determines if the conditional's block should be executed. In a loop, determines if the loop should begin another iteration or not.

Regardless, evaluates to a boolean value.

Conditional

A construct that makes code happen only when certain conditions are met. if/then is such a construct, as is switch.

Constant

Data that could be in variables that is instead typed directly into your code. Numbers and strings are the most common variable types that are expressed as constants.

Conversion Specification

A special string that contains a percent character, then a letter or number that defines a type. Used in format strings to determine how to describe the output string.

Disclosure Triangle

A standard widget that no one ever knows the name of. The little triangle that accompanies folders to show if they are expanded (points down) or not (points right).

Decrement Operator

The operator '--', which when appended to an integer variable will decrease that variable's value by one.

Developer Tools

The programs that Apple makes available to developers so that they can program for the Macintosh. The primary developer tool in versions of Mac OS X up to Jaguar is Project Builder, and after that it became Xcode.

Error

A message that the compiler will give you when you have code that does not compile. Unlike warnings, you cannot run your code if you have errors.

Errors are usually displayed by the developer tools in red.

Escape Sequence

A string used to represent characters not normally available as keystrokes. In C, these begin with a slash character, '\' and are followed by another character which distinguishes which character the sequence stands for. \n is a newline, \t is a tab. There are many more.

Equality Conditional

The operator '==', which evaluates to TRUE if the operands are equal. Not a single equal sign becuase that's used to assign values to variables.

Evaluate

To call all functions and substitute in all variable's values. This happens at run time.

FALSE

A boolean value, the opposite of TRUE. 0 is read as FALSE. See also NO.

Flow of Control

The order in which code is executed. Can be changed with conditionals and loops.

Format String

A special type of string that describes a string, by including conversion specifications inside of it. Used by printf() and NSLog(), and many other functions.

Function

A sections of code that can be called from other code. In C, you must declare the function before any code that calls it (or get a warning), and define the function somewhere in the code (or get an error).

Functions take inputs called arguments that can change how they work internally.

Functions have an associated block of code called the function body that defines the code that the function does.

Functions can return a value of any type to the code that calls it.

Note that functions have a distinction between declaration and definition, whereas a variable has none; declaration and definition are identical.

Function Call

A means by which one part of a program can call another part of a program. This makes it easy to use the same code over and over again, without having to rewrite it over and over again. Uses a syntax such as:

name(argument1, argument2)

where the function's name preceeds the parentheses, and all arguments are listed in the parentheses and separated by commas.

Function Body

The block of code in a function definition that defines the code that that function executes.

Function Declaration

A line of code that tells the compiler that a function exists, so that the compiler will not complain if you use that function. Has the form:

returnType functionName(argType argName1, argType argName2);

This can usually be copied and pasted from the functon definition.

Function Definition

Code that defines exactly what a function does. Has the form:

returnType functionName(argType argName1, argType argName2) {
	//function body
}

When the function is called, The arguments are implicitly defined in the function body, and take on the values passed into them by the function call.

Greater-Than Operator (aka '>')

The binary operator '>', which evaluates to TRUE if the left operand is greater than the right operand.

Greater-Than or Equal-To Operator (aka '>=')

The binary operator '>=', which evaluates to TRUE if the left operand is greater than or equal to the right operand.

Imperative Language

A programming language where the programmer tells the computer what to do in a specific order, one statement after another. C is such a language.

Infinite Loop

A loop whose condition is never FALSE, and so never ends.

Increment Operator

The operator '++', which when appended to an integer variable will increase that variable's value by one.

Input

The information that goes into a function, program, etc. The opposite of output.

Integer

A type that represents a whole number, without any decimal part. Declared with the keyword int. 5, -23, and 17,000 are all integers, while 2.3, .9, and pi are not. An integer can optionally be unsigned, which means that it must be positive.

Iteration

One pass through a loop. Begins with the evaluation of the condition. If the condition evaluates to TRUE, the code block is executed. In a for loop, also includes the evaluation of the step.

Less-Than Operator (aka '<')

The binary operator '<', which evaluates to TRUE if the left operand is less than the right operand.

Less-Than or Equal-To Operator (aka '<=')

The binary operator '<=', which evaluates to TRUE if the left operand is less or equal to than the right operand.

Line Number

A way of referencing a specific line of code. Line numbers always begin at the start of the file with the first line numbered one. You will often see line numbers in the format MyKeenFile.c:23, with the filename before the colon and the line number in that file after it. In the Developer Tools the line number is displayed at the top of any editor window in this format.

Loop

A code construct that tells the computer to execute code a specific number of times. Each loop has a type to determine general behavior, a condition which determines how many times the loop should run, and a block of code. Executing the loop can be logically divided into a number of iterations, which check the condition and execute the code in the block if the condition is true.

Nest

A term used in computer science meaning that one thing can go inside another. Blocks can nest in that one block can go inside another.

NOM

A boolean value, the opposite of YES. 0 is read as NO. See also FALSE.

Operator

A token that has a special meaning to the compiler. Operators are the verbs of C, and they act on the other tokens around them.

Operands

The inputs for an operator.

Output

The information that comes out of a function, program, etc. The opposite of input.

Project

The name Apple's Developer Tools gives to a program under development. When you create a project, the developer tools create a folder for any code files to live in, as well as a project file (which is really a package). Any support files will also go into this folder.

Project Builder

The primary Developer Tool for versions of Mac OS X up until Panther's release. Formerly known as ProjectBuilder (no space).

Return

The act of a function giving its results to the code that called it. Every function returns the type of data it is defined to return. Use the command return to accomplish this. It is good practice, though not required, to have return on the last line of the returning function.

Run

Making your code do whatever it is your code does. Once the code is compiled, the computer can run the code like it runs any other application. You can even go into the terminal and launch the code.

Run Time

The time when the program is actually running, after all code has been compiled.

Snippet

A section of code, usually when offered to someone. Can be a block, but doesn't have to be.

Step

The action taken at the end of a loop to set up the next iteration of that loop, and possibly to clean up the current iteration. Without a step, you end up with an infinite loop.

String

A list of characters that make a bit of text.

Ternary Operator
An operator that operates on three operands. There is only one such operator, so it is often called 'the ternary operator', since 'the question-colon operator' sounds dumb.
Token

In code, everything that is not whitespace is a token. Each section of text between sections of whitespace is a seperate token. This is a more general term than 'word', because an equal sign is also a token, but might not be counted as a word by some.

TRUE

A boolean value, the opposite of FALSE. Anything other than 0 is read as TRUE. See also YES.

Type

A way of interpreting data. Every variable has a type that tells the computer how to interpret the bits that the variable really represents. There are many different types defined in C, and the programmer can define his own types as well.

Variable

A section of memory that is set aside to hold some specific information. Variables are created with a variable definition, and afterwards are referenced by name, which much be one token. Every variable has a type assigned to it, to tell the computer how to read the variable.

Variable naming in C follows a standard that takes all the words in the name, capitalizes them, and takes out the spaces. The first letter is not capitalized. So a variable that represents the 'Number Of Doodads to Make' would be called 'numberOfDoodadsToMake'. Note that this is not a requirement, but it makes your code easier to understand to the rest of the world.

Varible Assignment

A line of code that assigns a value to an already-created variable.

Varible Declaration

A line of code that creates a variable with a specific name and type. It can be combined with a variable assignment in the same line.

Varible Definition

See variable declaration. Note that variables have no distinction between declaration and definition, becasue once a variable has a name and a type it is declared and defined, whereas a function must have separate declaration and definition.

Void

A type that represents a lack of data. Functions returning void are called procedures in some languages, but C and derivatives use 'function' as a catch-all term.

Warning

A message that the compiler will give you when it detects something possibly wrong with your program. A warning is not definitely a problem, but it is a questionable bit of code and the compiler is telling you to watch out. Unlike errors, you can still run with code that makes warnings, but they may lead to errors or crashes in your code at run time.

Whitespace

Spaces, Tabs, and Returns are collectively referred to as whitespace. In code, whitespace is ignored by the compiler, and so can be used to deliniate sections of code, or make code more readable to people.

Xcode

The primary developerer tool provided by Apple starting with Panther.

YES

A boolean value, the opposite of NO. Anything other than 0 is read as YES. See also TRUE.


Return to Loop the Loop

Return to the Mac DevCenter