0% found this document useful (0 votes)
4 views

Programming Languages

The document discusses programming languages, categorizing them into five levels from machine languages to natural languages, and outlines the roles of application and systems programmers. It highlights the importance of understanding syntax and semantics in programming, as well as common programming errors and control structures. Additionally, it covers program design aims such as readability, reliability, and maintainability, and factors to consider when selecting a programming language.

Uploaded by

festuskinyua187
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Programming Languages

The document discusses programming languages, categorizing them into five levels from machine languages to natural languages, and outlines the roles of application and systems programmers. It highlights the importance of understanding syntax and semantics in programming, as well as common programming errors and control structures. Additionally, it covers program design aims such as readability, reliability, and maintainability, and factors to consider when selecting a programming language.

Uploaded by

festuskinyua187
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 17

Programming languages

DIS 511 – DR J.T KARIUKI


Computer languages
 Computer languages allow programmers to
develop computer programs. Many different
languages have been developed, each with its
own unique vocabulary, grammar, and uses.
 The languages are categorized into 5 levels:
◦ Machine languages (First generation
languages);
◦ Assembly languages (Second generation
languages);
◦ High-level languages (Third generation
languages - procedural lan­guages);
◦ Very high-level languages (Fourth generation
languages - problem-oriented languages);
◦ Natural languages (Fifth generation
languages).
Programmers
Computer programming is the process
through which programs are designed and
developed to communicate with the computer
so that the computer can perform a specified
task.
In programming the programmer has to
understand the problem at hand, develop
appropriate plan and write the code that can
be understood by the computer and in
addition develop the documentation for the
program.
For an organization that is in need of a
software the sources available are:
a. Buy ready made software (Off the shelf
packages).
b. Tailor made software (Bespoke software).
c. Customization of available software.
Exercise
Discuss advantages and
disadvantages of:
a. Buy ready made software (Off the shelf packages).
b. Tailor made software (Bespoke software).
c. Customization of available software.
Programming languages
 Programming languages are said
to be lower level when they are
closer to the language that the
computer itself uses. They are
called higher level when they are
closer to the language people use
(e.g. more like English).
Programmers
Computer programmers are
grouped into two broad types:
a.Application programmers write
programs to handle a specific job,
such as a payroll program, marks
processing program, accounting
package.
b.Systems programmers, in contrast,
write programs that manage the
resources of the computer system,
such as operating systems
Programming language
 When learning a programming language, one
needs to learn two important aspects of a
programming language namely:
a. Its syntax
b. Its semantics
 The syntax of a language is the grammatical
rules that govern the ways in which words,
symbols, expressions and statements may be
formed and combined.
 The semantics of a language are the rules that
govern its meaning. In the case of computer
language, meaning is defined in terms of what
happens when the program is executed.
 Thus, in programming we must learn both
syntax (how to write it down correctly) and its
semantics (what will happen when it is
Programming errors
Syntax errors
◦ These results due to misuse of the rules
of the programming language being
used.
◦ Easy to detect as the program will not
run/execute
Logical errors
◦ Arise due to use of incorrect logic within
the program
◦ E.g Netpay=Grosspay +tax
◦ Program will run but give incorrect results
◦ Identified through the use of test
data/packs – Recall computer program is
Control structure
Program control structures are used
to regulate the order in which
program statements are executed.
All programming languages contain
features that allow the order of
instruction execution to be controlled.
Irrespective of the programming
language being used, there are three
categories of control structures:
i. Sequences
ii. Selections
iii.Repetitions/iterations
Sequential/Sequences
In this statements are executed in
the order /sequence in which they
appear in the program.
I.e statements are executed one
after the other
The implication is that statements
must be ordered in the way they
must be executed.
Selections/decision/if then
structure
This structure allows decision making
within the program.
The statements to be executed next is
dependent on the outcome from
previous statement
Therefore, the structure allows
alternative actions to be taken according
to the conditions that exist at particular
stages in program executions.
 Conditions are normally in the form of
expressions that when evaluated give
Boolean results (true or false). For
instance, Is age> 18?
Decision/selection
structure
Programming used to test conditions
and then, depending on the results of
that test, perform different operations.
The decision structures that in most
languages include:
I. If...Then

II.If...Then...Else

III.Select Case
Translators
A translator is a program that converts
statements written in one language to
statements in another language, e.g.
converting assembly language to machine
language.
There are three types of translators:
Assemblers – translate assembly language
into machine language. The resulting program
is executed when the assembly process is
completed.
Compilers – translate a high-level language
into machine language. The resulting program
can only be executed when compilation is
completed.
Interpreters- translate and execute each
source statement in logical sequence as the
program is executed
Program Design Aims
 Readability of the program.
A program should be easy for programmers to read
and understand. Readability of the program
enhances maintainability and portability.
Readability is normally achieved through:
(i) Identifying of program statements.
(ii) Incorporating comments within the program.
 Reliability
A program should be able to work at all times.
 Portability
Programs should be designed in such a way
that they can be transferred from different
makes of computers without being modified.
The implication of this is that a program
should not be machine dependent.
Program Design
Aims
Maintainability

A program should be easy to change or


modify as need arises. Maintainability of
programs is enhanced through readability.
Performance

Programs should execute the task quickly


and efficiently. This can be enhanced
through:
Avoiding unnecessary code.
Use of local variables as possible.
Storage saving
The program should not be unnecessarily
long.
Selection of a programming
language
i. Programmers experience
ii. Type of application being developed
iii. Ease of learning the language
iv. Level of support available
v. Features of the programming
language
vi. Language used in other applications
vii. Future of the language
viii.Performance and efficiency of the
language
Exercise
i. What is a user interface? What are
the characteristics of a good user
interface?
ii. The trend is towards Human
Computer Interaction. What is it
and what are its goals?
iii. In relation to design of user
interface, discuss the use of:
radio/option button, check boxes,
command button, list box, combo
box, text box, caption etc

You might also like