Please see the latest glossary; this one is old.
This is not meant to be the ultimate reference definition of all these words, just an pragmatic and informal description for those who already know what many of them mean. Mostly, this defines how we use words on CrossWise, as different languages use some of these words in different ways or describe some of these concepts with different words.
Array
An ordered group of values, indexed by Ints. Often the indices are consecutive, and start at zero. Similar to a Hashtable, with keys that are all Ints, but more efficient because lookup is faster and storage is more compact.
Assign
To take a value and store it into a variable.
Byte
8 bits. Most modern computers and communication channels work in terms of bytes. If something doesn't fit into a byte, you say how many bytes you need. If you need 65 bits, you get 72 because nobody's going to break up a byte to share with someone else. If your needs are simple, you can store one Character in a byte, or an integer from 0 to 255, or -128 to 127, or a boolean. If you're really desperate you can store 8 booleans in a byte.
Chapter
A major piece of functionality in a programming language, as displayed in a set of languages that you choose. For instance, Arrays in PHP and JavaScript.
Character
One unit of text. Each character is usually drawn with one glyph (image), although there are characters with multiple pieces of ink (i : ; ! ...) and also characters that must be drawn together (such as in Arabic or Hindi). Most modern systems have standardized either on ASCII encoding or on some superset based on it such as Unicode. Ascii characters need only one Byte per character, although Unicode and other #Multi-Byte Character systems need more.
Class
In Object Oriented Programming, a variety of Object. The definition of the class usually includes:
- name. Often classes are #Global; some languages force this to be true.
- constructor and sometimes destructor
- instance variables
- Instance Methods
- class Variabless
- class Methods
Class Method
A Function that is attached to a class. In a sense, it is a global function, or at least it has the same scope as the class itself. The class method does not take an Instance so that you can use it even if no instances have been created.
Class Variable
A variable that is attached to a class. There is one unique value in this variable, as opposed to instance variables where there's one per instance.
Constant
A variable that doesn't vary. A name that is set at compile time to a value, that you define because it is easier to remember the name than to type it out as a Literal each time. Some languages don't have the concept, so you just use a variable and hope nobody changes it by accident.
Usually there is some syntax to define it. In PHP you might say
define('D_HORSE', 'Equus ferus caballus');
define('D_COW', 'Bos primigenius');
whereas in JavaScript it woudl be:
const D_HORSE = 'Equus ferus caballus'; const D_COW = 'Bos primigenius';
Constructor
A special method for a class that creates new Instances. In a sense, it is a class method because you can use it any time without an instance. In a different sense, though, it is a Instance Method in that it operates on an instance - the instance that is being created. A constructor is your way of guaranteeing that objects of that class will always go out with certain mimimal things set up for it.
Declare
to say, in a language, that a certain entity exists. Usually this includes the name, and enough details for the compiler to make use of it, but not enough information to define it.
Define
to specify, in a language, all the details of a certain entity so that it can create it.
Destructor
A special method for a class that destroys unwanted Instances. Often, it is a Instance Method in that it operates on an instance - the instance that is being destroyed. A destructor is your way of guaranteeing that objects of that class will always clean up as they go away. Most modern scripting languages have Garbage Collection and as such, the time of destruction is somewhat unpredictable. When a program quits, sometimes destructors simply aren't run. Some languages have no destructors at all.
Entity
A nontrivial value. Usually they have several components and internal mechanisms. You use references to refer to entities. Almost always, objects are entities. In some languages such as Ruby, all entities and primitive values are objects, therefore every entity is an object. In other languages, such as PHP, there are several types of entities besides objects, such as arrays and resources. Sometimes strings are entities, depending on the language.
Feature
A major piece of functionality in a particular programming language. For example, PHP Arrays.
Garbage Collection
A recycling system for program memory. Large entities live in pieces of memory cut out of 'the heap'. After they are no longer needed, they are returned to the heap for reuse. Unfortunately, it's not always obvious when an entity falls out of use. Because Reference Counting allows memory leaks, the garbage collection algorithm traces all entity pointers to figure out which are no longer connected to anything useful, and then destroys them. Garbage Collection has the disadvantage that the program has to stop while the garbage collection is going on.
Global
A scope that extends over the entire program.
Hashtable
A dictionary object, an associative array. You give it a character string key and it gives you back a value stored under that key. A filesystem directory works this way, with filenames as the keys, and the file contents as typically large values. Often integers and other kinds of values can also be used as keys. Like an array, but more flexible because of the variety of keys.
Instance
An Object. Usually when you say object you are high-minded and thinking of the theoretical implications. Instance usually is to distinguish from a class or some of the instance's variables or methods.
Instance Method
A method that work on an Instance. class usually define instance methods. Within these methods, there is a special variable name, usually this or self that refers to the instance itself.
Often there is abbreviated syntax for referring to its instance variables. For instance, in C++ you can just use the variable name without any prefix as in jacks; in Ruby you would say @jacks, whereas in JavaScript and Python you have to say this.jacks.
Instance Variable
An Instance usually contains some variables that are attached to it. The beauty of Objects is that you can have this self-contained entity that knows about itself and can take care of itself with its own Instance Methods.
Int
An integer that's limited to a convenient size, depending on the machine. Usually a 32-bit (±2e9) or 64-bit integer (±6e19).
Literal
A value that you state explicitly in your programming source code. The syntax almost always depends on the Type of value you're trying to get across. Numbers are usually a sequence of digits, possibly with decimal points, exponents, imaginary parts and what not. strings are usually enclosed in quote characters of some kind. Booleans are usually the words True or False, with some rules about case of the letters.
More complex entities require more verbiage. For instance, in JavaScript you can make an array like [11,22,33]. In PHP however the same thing requires a function call array(11, 22, 33). Often such entites cannot really be written literally without some call to a function or constructor.
Method
A Function that is part of a class.
Multi-Byte Character
A character that needs more than one byte to represent it. Most such systems use a sequence of bytes to represent the non-ascii characters within a stream of bytes. For instance in Shift JIS encoding, the two bytes 0x9d 0x91 represent the Japanese character 搗. Unicode, on the other hand, is a stream of 16-bit codes (at least in UCS-2) and every character uses one such code.
Name
A string that you use to handle variables, constants, classes and other things in your program. Usually it must start with a letter or underbar, and usually the rest of the characters must be letters, underbars or digits. Some languages allow characters above the ascii range, so you can insert accented letters, ideographs and even some mathematical symbols into names.
Object
In Oriented Programming, a value that has a class, probably some instance variables, and methods.
Primitive
A value (typically smaller) that is not shared between variables, despite an assignment. Each variable that refers to it concerns a different instance. Typical primitives include numbers, booleans, and sometimes strings and timestamps.
p = 'The fox was gone'; q = p; q[4] = 'b'; q= 'The box was gone' p= 'The fox was gone'
Reference
A compact value that points to a larger entity data structure. Making changes to a reference affects the target entity, which might be shared among other references. References are the way to refer to objects, arrays, hashes, dictionaries, trees, and sometimes strings, timestamps or very long numbers.
p = 'The fox was gone'; q = p; q[4] = 'b'; q= 'The box was gone' p= 'The box was gone'
Reference Counting
A system of managing Entity memory where each entity keeps a count of how many References point to it. When the count goes to zero, the entity is destroyed. This system leaks memory when circular structures are abandoned. For instance, if an Object has an instance variable that points to itself, its reference count will never go to zero and it'll never be destroyed, even when everybody's forgotten about it.
Requirement
A major piece of functionality in a programming language, described generally, without making reference to any particular languages. For example, Arrays.
Scope
The area of a program where you can use a particular name.
String
A value that consists of zero or more characters in a sequence. Strings make up the text that you're reading right now. Usually character positions are numbered; more precisely, the locations between are numbered, where 0 is before the first character, 1 is after, and so on. Therefore a string with 5 characters has locations 0 through 5, six in all.
Type
The type of a value tells what kind of thing it is in a language. Typical types include numbers, strings, objects, and more. Number might be further divided into float or integer or a long number with arbitrary precision. In some of these there are further divisions as to size, such as short or long integers. strings might come in 8-bit and 16-bit varieties. More complex types might include Objects, Arrays, or other things.
In some languages such as Ruby, which is extremely object-oriented, the type and the class of a value are the same thing. In most other languages, there are fundamental differences between values of different types.
Unicode
A group of character encoding systems that can encode almost all of the popular language writing systems in the world, see unicode.org[1]. Fundamental to Unicode is the BMP, Basic Multilingual Plane, a way of encoding characters into 16-bit words. The Japanese character 搗 is known as U+6417 in Unicode, where the U+ tells you that it's a Unicode character, and the rest is hexadecimal. In the UCS-2 encoding system, which is just a stream of 16-bit words, this becomes the 16-bit value ox6417. Unicode supplies the BOM (Byte Order Mark) character U+FEFF if you have to ram this through an 8-bit stream; if you see the character value U+FFFE on the other end, you know you have your bytes in the wrong order.
Many systems simply use 16-bit characters for everything, and therefore UCS-2 is the way to go. Java and JavaScript both use this exclusively.
If you must use 8-bit strings, it's very convenient to use the UTF-8 encoding system, which is a stream of bytes. Characters use 1, 2, 3 or 4 bytes, and the 1 byte forms are identical to Ascii. In that system, the Japanese character 搗 becomes the three bytes oxE6 ox90 ox97.
Unicode also includes more code pages beyond the 64k BMP that we all thought was enough, and more encoding schemes to encode it.
Value
The currency of a programming language. A unit of data. Might be a Reference or a Primitive.
Variable
A storage place for a value. Usually has a name, and possibly a scope and often are attached to some sort of complex value as, for instance, an instance variable is attached to its object instance.
![[Main Page]](/cw/skins/common/images/CrossWiseLogo.jpg)