Computer programming concepts
The concepts discussed on this page are essential knowledge to anyone who wants to become skilled in computer programming. While some are not universal, these concepts are present in the majority of computer programming languages and/or are a fundamental part of the programming process.
-
Algorithm
A set of steps for carrying out a specific task. Algorithms are used extensively in computer programming to arrive at a solution for a problem. The process of creating an algorithm involves documenting all the necessary steps needed to arrive at the solution and how to perform each step. A real world example of an algorithm would be a recipe. The instructions of a typical recipe (add ingredients, mix, stir, etc.) are an algorithm. -
Source code
The actual text used to write the instructions for a computer program. This text is then translated into something meaningful the computer can understand. -
Compiler
A software tool that translates source code into data that the computer can understand. Specifically, a compiler is used to turn source code into object code. The object code is then passed through a program called a linker which turns it into an executable program. -
Data type
The classification of pieces of information in a program. The amount of different data types varies between languages. Typically, there are data types for integers (whole numbers), floating-point numbers (numbers with a decimal part), and single characters. To distinguish between different data types, a computer uses special internal codes. -
Variable
A container which represents a value in a program. Variables can store different types of data including numeric values, single characters, and text strings. The value of a variable can change all throughout a program. -
Constant
The same thing as a variable with one major difference - the value of a constant does not change, while the value of a variable can change all throughout a program. -
Conditional
A set of code that will execute only if a cetain condition is true. Conditionals are used to test expressions and perform certain operations accordingly. For example, you could test a number input by the user and if it is too high print the message "The number entered is to high" and the program exits. Thanks to conditionals, a program can work differently every time it runs. -
Array
A special type of variable used in many programming and web languages including PHP, Javascript, and Java that contains a list of related values. For example, a colors array would contain a list of colors. -
Loop
A segment of code that executes repeatedly based on a certain condition. Loops are used to perform tasks repeatedly a certain amount of times. For example, if you needed to print the numbers 1 to 10. You can use a loop for this task instead of manually printing all the numbers. -
Function
A set of code used to carry out specific tasks. A function can take parameters which will effect its output as well as return values. Functions prevent unneccesary redundancy because you can use them as much as needed instead of retyping some code over and over. For example, if you need to multiply two numbers, instead of doing the calculation manually every time, you can supply the data to a function through some parameters which will do it for you. -
Class
A template for a real world object to be used in a program. For example, a programmer can create a car class which represents a car. This class can contain the properties of a car (color, model, year, etc.) and functions that specify what the car does (drive, reverse, stop, etc.). Classes are used in object-oriented programming.