Computer Programming & Computer Programming Languages
Everywhere you go these days, you hear the word "Computer Programming" and it seems to amaze you, what are these people saying or what do they mean? The concept behind computer programming is large, and for you to fully understand computer programming, there are a couple of things to note/study/understand.
What is Computer Programming?
Computer programming is the act of logically and sequentially developing, designing, and writing computer programs using a chosen programming language. It is a skill set that requires you to use a programming language of your choice or best suits the need to develop software or a program used in solving problems. Programming languages provide you with instructions in human-readable forms called codes which will be translated into machine languages that the Computer devices and other hardware peripherals understand.
Programming Languages are languages that can be used to write instructions that the computer will execute to perform a task. Programming Languages are diverse and are used differently depending on the task you want to use them for or the type of solutions you want to build.
Programming Languages can be divided into 2 major types:
Low-Level Programming Languages
High-Level Programming Languages
Low-Level Programming Languages
Low-Level Programming Languages are languages that the digital computer understands or closely resembles translates to the language the digital computer understands.
They are further divided into 2:
Machine Language
Assembly Language
Machine Language: These are languages that digital computers/devices understand. Machine Languages are a stream of binary digits (0's and 1's). Binary numbers are what computers understand and can interpret. These binary numbers are further standardized into
Binary [base2]
20 = 0001 0100 (decimal to base 2)
Octal [base7]
20 = 24 (decimal to base 7)
Decimal [base10]
20 = 20 (decimal to base 10)
Hexadecimal [base16]
16 = 14 (decimal to base 16)
Others include
BCD (Binary Coded Decimal - uses 4 bits for data representation),
ASCII (American Standard Code for Information Interchange)
EBCDIC (Extended Binary Coded Decimal Interchange Code - uses 8 bits for data representation)
Unicode (uses 7 to 8 bits for each character.)
In binary, the decimal number 1
is translated to 0001
, 2
in decimal is translated to 0010.
To add 1 and 2, 0001
10110010
0010
= 0011
Note that 10110010
is the ASCII code for the plus +
symbol.
Assembly Language: These are programming languages that are closest to what digital computers/devices understand. Rather than using the streams of binaries, mnemonics are used to represent certain streams of binaries which will be called when you need to use that stream of binary digits.
For example: Adding 2 numbers
# represented in plain english or mathematical form
1 + 2 = 3
# represented in binary form / Machine Language
0001 10110010 0010 = 0011 # 10110010 is the ASCII code for +
# represented in Assembly Language form
MOV EAX, 1
ADD EAX, 2
# Here ADD is used to replace the ASCII Code for + which is 10110010
Some Mnemonic commands include
ADD - Addition
MUL - Multiply
MOV - Move data to a register
JMP - Unconditional Jump
INC - Increments a memory variable
AND - Performs logical AND operations
POP - Pops word off a Stack
PUSH - Push word unto a Stack
etc.
Note: For an Assembly language code to be fully functional or understood by the computer/digital device, it has to be converted into the machine language code equivalent. This phenomenon is known as "Translation" and the translator used is called an "Assembler".
High-Level Programming Languages
Programmers find it difficult to code, debug or write programs using machine language or assembly languages because you have to learn the mnemonics and most codes were not portable (the codes for a 32-bit processor differ from that of a 64-bit). You have to know the actual opcodes for different machine architectures. As a result, High-Level programming languages were born. High-Level programming languages are closer to human/natural languages (spoken or written). In High-Level programming languages, program statements look more like a sentence in English language or an abbreviated English language form.
Translators: Programs written with High-Level programming languages or Low-Level programming languages need to be translated into machine language or its equivalents before they can be executed. Translators convert codes from one computer language into another preferably a language the digital computer's circuits and buildups can understand.
There are different translators and they include:
Interpreter
Compilers
Assemblers
Assemblers: Assemblers are programs that create object codes from source codes written with Assembly language, by translating the syntaxes, mnemonics and memory addresses into their binary equivalent. Assemblers are different and have different syntaxes for different CPUs and PC architectures. An example of assembled language is the Assembly Language.
Interpreters: Interpreters are computer programs that directly execute instructions written in other programming languages different from a machine language or assembly language line by line. Interpreted programs always translate the source code line by line from top to bottom following the sequence of execution or events as structured. Anytime you run an interpreted program, it "parses" the source code line by line to make sure your code adheres to the syntaxes and semantics of that language, and "translates" the source code into an immediate representation of the solution ready to be executed and accept inputs. Examples of interpreted languages are Python, Javascript, Perl, PHP, BASIC, Lisp, Ruby, Scala, etc.
Compilers: Compilers are computer programs that translate instructions written in high/low-level programming languages. The difference between the compiler and the interpreter is that it translates the whole code and the object code which is an executable file is separated from your source code. To get an updated object code for your program in cases where changes were made, you have to recompile. Examples of compiled languages are Java, C, C++, FORTRAN, Rust, Prolog, etc.
Subscribe to my newsletter
Read articles from Dukeson Ehigboria O. directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Dukeson Ehigboria O.
Dukeson Ehigboria O.
I am a developer from Nigeria. I am currently studying for Software Engineering @ ALX Africa. I am a tech enthusiast and a PHP evangelist. I love to learn new things as well as reach out to others with what I have learnt. Knowledge is meant to be passed on and that is what I intend to do using this platform. Learning is not one sided, so I intend to learn too from way too experienced hands in the field technology and software development.