Lecture 1: Introduction to Programming
2013/14 Academic Year By Prof. Elijah I. Omwenga
Introduction to Programming
Program: The term program refers to a set of instructions that instructs a computer on what to do. Programs are Solutions to Problems. These instructions are written using programming languages.
A program can instruct a computer to: – Read/ accept Input data – Calculate or compare – Store data – Write or display Output The term software refers to a computer program or set of programs and its associated documentation such as user guide, technical manual
• Programming: This refers to the process of writing computer programs using a programming language • The person who write such instructions is a programmer • Mathematicians have been credited for designing most of the programming languages and programs in the history of computing
• Each natural language has a systematic method of using symbols of a language. This is dictated by rules of grammar – semantic (structure)and syntax (words and symbols) • Similarly, computer programming languages are governed by the structure and syntax. • In natural languages one can break the syntax rule, but we can use inference (guesswork) to get what the person means. However, computers being machines, are receptive to only the exact syntax rules of the language being used.
Types of Programming Languages
• A programming Language - is a set of rules that provides a way of writing instructions that instructs a computer on what operations to perform. • Programming languages can be classified into two broad categories namely: • Low level programming Languages • High level programming Languages • Low level languages further classified into two generations namely: – First Generation- Machine languages – Second Generation -Assembly languages
Types of Programming Languages
2. High-level languages further classified into three generations namely: – Third Generation- Procedural languages – Fourth Generation - Problem-oriented languages – Fifth Generation - Natural languages
Low Level Languages
• This is the oldest form of computer programming used to program first generation computers such as UNIVAC and ENIAC. Plug boards were used to represent data in binary (machine) form in the computer the circuitry.
• Data represented in series of 1s and 0s are said to be in machine language. For example, the code below represent a segment of a machine code: 1011010100 1010111101 1000100100
• Machine language also varies according to make of computer, another characteristic that make them hard to work with.
Assembly language use symbolic (mnemonics) such as ADD which allowed programmers to specify instructions simple words such as ADD, MP etc. To convert a program from assembly to binary form, a translator known as assembler was used.
Compared to machine languages, assembly languages are much easier for humans to understand and to use. The machine language code we gave above could be expressed in assembly languages as: ADD 210(8,13),02B(4,7) PACK 218(8,13),02F(4,7) MP 212(6,13),21D(3,13)
Advantages of low level languages
1. They are executed very fast since no translator or minimum translation is involved. 2. 3. They require very little memory space. They have a high level of security since a program
written in machine language is difficult to change or
Disadvantages of low-level languages
1. 2. 3. 4. Machine languages are time-consuming because the binary code instructions are complex. They are difficult to understand. They are difficult to debug and hence difficult to maintain. They are not portable i.e can only be used by specific computers.
High level languages
• Procedural languages, also known as third generation languages uses human language. The are intended to solve general problems. Examples of procedural...
Please join StudyMode to read the full document