Chapter 4 Types of Programming Language Edited
Chapter 4 Types of Programming Language Edited
A DMC SC 2023
in
High-level languages and low-level languages
High-level languages
st
A programming language that is independent of computer hardware.
• A program written in a HLL needs to be translated into machine code before it is
executed. u
Programs written in a high-level language are easier to:
g
i. read and understand as the language used is closer to English,
ii. write in a shorter time,
u
The following snippet of program to add two numbers together is a single program
statement written in a typical high-level language:
r.
Low-level languages
Machine code
A binary programming language written in machine code that can be loaded and executed
without translation.
Page 1 of 5
O Level Computer Science P1 Software: Programming Languages © N.A DMC SC 2023
The following snippet of program to add two numbers together is written in typical machine
code, shown in both hexadecimal and binary, and consists of three statements:
in
Language Advantages Disadvantages
i. Independent of the type of computer being used i. Programs can be larger
ii. Easier to read, write and understand programs ii. Programs can take longer to execute
High-Level iii. Quicker to write programs iii. Programs may not be able to make use of
st
iv. Programs are easier and quicker to debug special hardware
v. Easier to maintain programs in use u
i. Can make use of special hardware i. It takes a longer time to write and debug
ii. Includes special machine-dependent instructions programs
g
Low-level iii.Can write code that doesn’t take up much space in iii. Programs are more difficult to understand
primary memory
iv. Can write code that performs a task very quickly
u
A
Assembly languages
Low-Level Languages
Page 2 of 5
O Level Computer Science P1 Software: Programming Languages © N.A DMC SC 2023
Programmers who write programs in an assembly language do so for the following reasons:
i. To make use of special hardware.
ii. To make use of special machine-dependent instructions.
iii. To write code that doesn’t take up much space in primary memory.
iv. To write code that performs a task very quickly.
The following snippet of program to add two numbers together is written in a typical
assembly language and consists of three statements:
in
st
Translators
A translator converts a program written in a high-level language program (or low-level
u
assembly language program) into machine code.
g
Types of translator program
i. Compiler
u
ii. Interpreter
iii. Assembler
A
in one go
M
Page 3 of 5
O Level Computer Science P1 Software: Programming Languages © N.A DMC SC 2023
in
shorter time.
st
An IDE is a suite of software development tools used by programmers to aid the writing and
development of programs. u
IDEs usually have these features:
g
i. code editors
ii. a translator
u
vi. auto-correction
vii. an auto-documenter and prettyprinting
r.
Code editor
• Allows a program to be written and edited without the need to use a separate text editor.
M
Translator
Page 4 of 5
O Level Computer Science P1 Software: Programming Languages © N.A DMC SC 2023
Error diagnostics
Auto-completion
• Context-sensitive prompts with text completion for variable names and reserved words.
Auto-correction
in
st
u
g
u
A
r.
M
Page 5 of 5