Programming glossary
The following table contains some technical programming phrases that are often used and heard in the field of computer science and programming, that you need to be familiar as well.
Expression | Description |
---|---|
algorithm | A general method for solving a class of problems. |
bug | An error in program that has to be resolved for successful execution of the program. |
compiled language | A programming language whose programs need to be compiled by a compiler in order to run. |
compiler | A software that translates an entire high-level program into a lower-level language to make it executable. |
debugging | The process of finding and removing any type of error in the program. |
exception | An alternative name for runtime error in the program. |
executable | An object code, ready to be executed. Generally has the file extension .exe or .out or no extension at all. |
formal language | A language that is intentionally designed for specific purposes, which, unlike natural languages, follows a strict standard. |
high-level language | A programming language (e.g., Python, Fortran, Java, etc) that has high level of abstraction from the underlying hardware. |
interpreted language | A programming language whose statements are interpreted line-by-line by an interpreter and immediately executed. |
low-level language | A programming language that has a low-level of abstraction from computer hardware and architecture, such as Assembly. Very close to machine code. |
natural language | A language that evolves naturally, and has looser syntax rules and standard compared to formal languages. |
object code | The output of a compiler after translating a program. |
parsing | Reading and examining a file/program and analyzing the syntactic structure of the file/program. |
portability | A program's ability to be exucatable on more than one kind of computer architecture, without changing the code. |
problem solving | The process of formulating a problem and finding and expressing a solution to it. |
program | A set of instructions in a that together specify an algorithm a computation. |
runtime error | An error that does not arise and cause the program to stop, until the program has started to execute. |
script | A program in an interpreted language stored in a file. |
semantic error | A type of error in a program that makes the program do something other than what was intended. Catching these errors can be very tricky. |
semantics | The meaning of a program. |
source code | A program in a high-level compiled language, before being compiled by the compiler. |
syntax error | A type of error in program that violates the standard syntax of the programming language, and hence, the program cannot be interpreted or compiled until the syntax error is resolved. |
syntax | The structure of a program. |
token | One of the basic elements of the syntactic structure of a program, in analogy with word in a natural language. |
dictionary | A collection of `key:value` mapping pairs, in which the values can be obtained by calling the value's key. |
hashable | A Python object (e.g., variable) that has a hash value which never changes during its lifetime. |
immutable | A variable or value that cannot be modified. Assignments to elements of immutable values cause a runtime error. Example immutable Python entities are tuples and strings. |
invocation | The process of calling an object's method, usually done through <object name>.<method name> notation. |
list | A sequence of comma-separated heterogenous values next to each other. |
method | Similar to a function, a method is a predefined built-in Python script that performs a specific task on the data object to which the method belongs. |
mutable | A variable or value that can be modified. Examples of mutables in Python are lists, and dictionaries. |
set | An unordered collection of unique elements, just like the mathemtical sets. |
string | A sequence of characters next to each other. |
tuple | An immutable data value that contains related elements. Tuples are used to group together related data, such as a person’s name, their age, and their gender. |
The contents of a computer program
Although different programming languages look different in their syntax standards, virtually all programming languages are comprised of the following major compnents (instructions):
- input
Virtually every program starts with some input data by the user, or the input data that is hard-coded in the program.
- mathematical/logical operations
Virtually all programs involve some sort of mathematical or logical operations on the input data to the program.
- conditional execution
In order to perform the above operations on data, most often (but not always) there is a need to check if some conditions are met in the program, and then perform specific programming instructions corresponding to each of the conditions.
- repetition / looping
Frequently it is needed to perform a specific set of operations repeatedly in the program to achieve the program’s goal.
- output
At the end of the program, it is always needed to output the program result, either to a computer screen or to a file.
Debugging a program
As it is obvious from its name, a bug in a computer program is annoying programming error that needs fixing in order for the program to become executable or to give out the correct answer. The process of removing program bugs is called debugging. There are basically three types of programming bugs (errors):
Syntax error
A program, whether interpreted or compiled, can be successfully run only if it is syntactically correct. Syntax errors are related to the structure and standard of the language, and the order by which the language tokens are allowed to appear in the code. For example, the following Python print
statement is a syntax error in Python 3 standard, whereas it was considered to be the correct syntax for print
in Python 2 standard.
print 'Hello World!'
File "<ipython-input-21-10fdc521e430>", line 1
print 'Hello World!'
^
SyntaxError: Missing parentheses in call to 'print'
The syntactically-correct usage of print
in Python 3 would be,
print ('Hello World!')
Hello World!
Runtime error
Runtime errors or sometimes also named exceptions are a class of programming errors that can be detected only at the time of running the code, that is, they are not syntax errors. Examples include:
- memory leaks (very common error in beginner C and C++ codes)
- uninitialized memory
- access request to an illegal memory address of the computer
- security attack vulnerabilities
- buffer overflow
These errors can be sometimes tricky to identify.
Semantic error
Unlike syntax errors that comprise of something the compiler/interpreter does not understand, semantic errors do not cause any compiler/interpreter error messages. However, the resulting compiled/interpreted code will NOT do what it is intended to do. Semantic errors are the most dangerous types of programming errors, as they do not raise any error flag by the compiler/interpreter, yet the program will not do what it is intended to do, although the code may look perfectly fine on its face. A semantic error is almost synonymous with logical error. Dividing two integers using the regular division operator /
in Python 2 and expecting the result to be real, would result in a semantic error. This is because, in Python 2 standard, the regular division operator is equivalent to integer division for integer operands:
In Python 2,
2/7
0
Whereas, you might have really meant a float division by using /
, as in Python 3,
2/7
0.2857142857142857