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

000 - Programming Languages

Uploaded by

oiiichiefens
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

000 - Programming Languages

Uploaded by

oiiichiefens
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

EPG125C / EPG125A

ENGINEERING PROGRAMMING I
Programming Languages
What is programming?

Programming is the process of designing and building


an executable computer program to accomplish a
specific task. It involves writing a set of instructions
that a computer can understand and execute. These
instructions, often referred to as code, are written in
programming languages such as Python, Java, C++, or
JavaScript.
Generations of Programming
Languages
There are five generations of Programming
1st Generation languages. The first two generations are called
low-level languages. The next three generations
Low-Level are called high-level languages.
2nd Generation
▸ Low-level: These languages provide minimal
abstraction from the hardware, often directly
corresponding to machine instructions and
3rd Generation memory management.

High-Level 4th Generation ▸ High-level: These languages offer a higher


level of abstraction from the hardware,
making them more human-readable and
5th Generation easier to understand by abstracting away
low-level details.
First Generation (1940s – 1950s)

Also known as machine language or first- ADVANTAGES


generation languages, these are low-level
languages that directly correspond to the Direct control over hardware, highest level of
instructions executed by a computer's CPU. efficiency.
They consist of binary code, represented by 0s
and 1s, and are specific to the computer
architecture.

HOW THEY WORK DISADVANTAGES


First-generation languages are machine
languages, consisting of binary code (0s Extremely difficult for humans to understand and
and 1s) that directly correspond to CPU program directly, highly architecture-dependent.
instructions. They are specific to the
computer architecture.
2nd Generation (1950s – 1960s)

Assembly languages fall into this category. ADVANTAGES


They use mnemonics to represent machine
code instructions, making programming easier More human-readable than machine language,
compared to directly manipulating binary easier to program and understand.
code. However, they are still closely tied to the
computer's architecture.

HOW THEY WORK DISADVANTAGES


Programmers work with CPU registers and
memory addresses, and assembly language
Still architecture-dependent, not as portable or
programs are translated into machine code using
easy to maintain as higher-level languages.
an assembler. Assembly language requires a
deep understanding of computer architecture
and is platform-specific.
3rd Generation (1950s – Present)

ADVANTAGES
Third-generation languages are high-level
programming languages designed to be more Portability across different platforms, easier
human-readable and independent of the maintenance, higher productivity.
underlying hardware. Examples include Fortran,
COBOL, C, Java, Python, and many others.

HOW THEY WORK DISADVANTAGES

They use constructs like variables, loops, and


Less efficient than low-level languages, may
functions, and they are portable across different
require more memory and processing power.
platforms.
4th Generation (1970s – Present)

ADVANTAGES
Designed to further abstract programming
from the hardware and focus on specific Rapid development, focus on specific problem
problem domains, such as database query domains, higher-level of abstraction.
languages (SQL), report generators, and
domain-specific languages (DSLs).

HOW THEY WORK DISADVANTAGES


Fourth-generation languages focus on specific
problem domains, such as database query Limited in scope, may not be suitable for all types
languages, report generators and business of programming tasks.
analytics.
5th Generation (1980s – Present)

Fifth-generation languages are designed to ADVANTAGES


make the computer solve a given problem
without the programmer. This way, the user Potential for solving complex problems, leveraging
only needs to worry about what problems need cutting-edge technologies..
to be solved and what conditions need to be
met, without worrying about how to implement
a routine or algorithm to solve them

HOW THEY WORK DISADVANTAGES


Fifth-generation languages often refer to future or
experimental technologies, focusing on advanced Often experimental, limited adoption, may lack
techniques such as artificial intelligence, logic mature tooling and support.
programming, and parallel processing.
Compiled vs. Interpreted
Languages

9
Compiled vs. Interpreted
Languages
Compiled Interpreted
In compiled languages, the code In interpreted languages, the code
written by the programmer written by the programmer is
(source code) is transformed into executed line-by-line by an
machine code (binary code) by a interpreter at runtime, without
compiler before it is run on the being converted into machine
computer. This machine code is code beforehand.
specific to the target operating
system and hardware.

10
11
Compiled Languages
Examples: C, C++, Rust, Go

Advantages Disadvantages

Performance: Compiled code generally runs Compilation Time: The process of compiling
faster because it is directly executed by the can take time, especially for large projects.
computer's CPU.
Platform Dependence: Compiled code is
Optimization: Compilers can perform specific to a particular type of system,
optimizations to make the code run more meaning a different version of the code
efficiently. needs to be compiled for each type of system
it will run on.
Error Checking: Many errors can be caught at
compile-time before the program runs.

12
Interpreted Languages
Examples: Python, JavaScript, Ruby, PHP

Advantages Disadvantages

Portability: Interpreted languages are Performance: Interpreted code typically


generally more portable because the same runs slower than compiled code because
code can be run on any system with the it must be translated on the fly.
appropriate interpreter.
Runtime Errors: Errors may only be
Ease of Testing: Code can be tested and detected at runtime, which can make
executed immediately without the need debugging more challenging.
for a compilation step.

Dynamic Typing: Many interpreted


languages support dynamic typing, making
them flexible and easier to write.

13
Additional Resources

▸ 1st Generation Programming Language


▸ 2nd Generation Programming Language
▸ 3rd Generation Programming Language
▸ 4th Generation Programming Language
▸ 5th Generation Programming Language
▸ Compiled vs. Interpreted Languages

You might also like