BFOIT - Introduction to Computer Programming

Appendix A (Jargon)

-   B   -

binary number
A number composed of only zeros and ones (0, 1). You are familiar with counting in the decimal number system which has 10 symbols (0, 1, 2, 3, 4, 5, 6, 7, 8, 9). Here is a comparison:

Decimal Binary
0 0
1 1
2 10
3 11
4 100
5 101
6 110
7 111
8 1000
9 1001
10 1010
11 1011
12 1100

There are only 10 different kinds of people in the world: those who know binary and those who don't.
- Anonymous

block and/or body
Just as you have a body that holds all of your contents, so do things in programming languages.

In Logo, procedure definitions have a title line, a body, and an end line.  The title line introduces the definition and contains the name of the procedure.  The end line denotes the completion of the procedure definition.  All of the lines of instructions in between the title line and the end line are instructions - what the procedure does when it is invoked - the procedure's body.  Here is an example of a procedure with a one-line body that prints "Hi!"

   to sayHi 
     println "Hi!
In Java, when you write the source code for a class or a method, you provide two pieces: a header and a body.  Think of the header as an introduction and the body as what the thing you've introduced consists of. Class and method bodys have specific syntax. They start with a left/open squiggly bracket, are followed by all the stuff (declarations, statements) that makes them do what you want, and are finished off with a right/closing squiggly bracket. Here is an example of a method that does nothing, but has the proper syntax:
   void doNothing()
Now, there is another thing in the Java language that looks just like the body of a class or method. In Java-jargon we call this thing a block statement. Block statements are allowed to be substituted where Java's syntax allows any statement to go. The most common places you will use block statements are in for, if, and while statements.  As an example:
   if ( getMouseX() < -50 )
      if ( getMouseY() > 50 )
         return 1;
      if ( getMouseY() > -50 )
         return 4;
      return 7;

A primitive data type provided by Java that has only two possible values: "true" or "false"

When you include the word "true" or the word "false" in your source code, it is interpreted as a literal value of type boolean; it's just like putting numbers in your source code which are interpreted as expressions of type int.

The most common use of things (expressions, fields, literals) of type boolean is to provide direction to the Java Virtual Machine - telling it what to do at some point in our program.

A programming term for mistake in the logic of a computer program. The name "bug" is credited to Admiral Grace Murray Hopper, one of the pioneers of electronic computing. She is best known for inventing the computer language COBOL in 1955.

However, in 1943, Admiral Hopper was working the development of the Mark II computer which was used for scheduling supply ships, creating ballistic tables for aiming navy guns (the real kind - not for some video game), and other top-secret calculations. As the story goes, at one point when she was getting the system to work she traced a malfunction to a dead moth stuck between two electrical elements. The bug was keeping electricity from flowing between these components of a relay. The moth was taped into the log book with the caption: "First actual case of a bug being found." If you ever have a chance to visit the Naval Surface Weapon Center, check out its museum which is still preserving the "bug."

Other jargon:  A   B   C   D   E   F  G H  I   J  K  L   M  N  O   P  Q  R   S   T  U  V   W  X Y Z

Back to HomePage

Public Domain Mark
This work (BFOIT: Introduction to Computer Programming, by Guy M. Haas),
identified by Berkeley Foundation for Opportunities in IT (BFOIT),
is free of known copyright restrictions.