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

CSC 332 Survey of Programming Languages

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

CSC 332 Survey of Programming Languages

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

CSC 332

Survey of
Programming
Languages
C/C++, C#, JAVA, PYTHON, LISP,
PERL, ALGOL AND PROLOG
Introduction CSC 332: Survey of Programming Languages is a Second Semester course. It is a
four (4) credit degree course available to three hundred level students offering Computer
Science and all related courses, studying towards acquiring a Bachelor of Science in Computer
Science and other related disciplines. The course is divided into four (4) modules and 15 study
units. It entails the concept of programming languages. It further deals with general overview
of programming languages. The course also introduces language description, evolution of level
of programming languages and language comparison. concepts underlying modern
programming languages: C/C++, C#, Java, Python, LISP, PERL, ALGOL and PROLOG.
- T H E O V E R A L L A I M O F T H I S C O U R S E I S T O T E A C H Y O U G E N E R A L O V E RV I E W O F P R O G R A M M I N G L A N G U A G E S :
E V O L U T I O N , G E N E R AT I O N , C O N C E P T S , A P P L I C AT I O N D O M A I N A N D C R I T E R I A F O R L A N G U A G E E VA L U AT I O N .
T H E C O U R S E I S D E S I G N E D T O D E S C R I B E T H E F U N D A M E N TA L C O N C E P T S O F P R O G R A M M I N G L A N G U A G E B Y
D I S C U S S I N G T H E D E S I G N I S S U E S O F T H E VA R I O U S L A N G U A G E C O N S T R U C T S , E X A M I N I N G T H E D E S I G N
C H O I C E S F O R T H E S E C O N S T R U C T S I N S O M E O F T H E M O S T C O M M O N L A N G U A G E S , A N D C R I T I C A L LY
C O M PA R I N G D E S I G N A LT E R N AT I V E S , F U N D A M E N TA L S Y N TA C T I C A N D S E M A N T I C C O N C E P T S U N D E R LY I N G
MODERN PROGRAMMING LANGUAGES, DIFFERENT MODERN PROGRAMMING LANGUAGES
*Course Aim:
This course aims to take a step further in teaching you the basic and best
approach to survey programming languages. The general objective is
to:
1.Demonstrate understanding of the evolution of programming languages and
relate how this history has led to the paradigms available today.
2.Identify at least one outstanding and distinguishing characteristic for each of
the programming paradigms covered 3. Evaluate the tradeoffs between the
different paradigms, considering such issues as space efficiency, time efficiency
(of both the computer and the programmer), safety, and power of expression. 4.
Identify at least one distinguishing characteristic for each of the programming
paradigms covered in this unit.
5.Describe The Importance And Power Of Abstraction In The Context Of
Virtual Machines. 6.Explain The Benefits Of Intermediate Languages In The
Compilation Process. 7. Evaluate The Tradeoffs In Reliability Vs. Writability
8.Explain the differences between machine-dependent and machine-independent
translation and where these differences are evident in the translation process. Examine,

9.evaluate and compare these languages 10. Discuss evolution, history, program
structure and features of some commonly used programming languages paradigm
such as C/C++, C#, Java, Python, LISP, PERL, ALGOL and PROLOG. To increase
capacity of computer science students to express ideas 11.Improve their
background for choosing appropriate languages 12. Increase the ability to learn
new languages.

-The unique advantage of C++ over other object-oriented programming


languages is its fine-grained control over system resources and performance.
this characteristic is especially critical in scenarios requiring high efficiency
and precise resource management…
What is Programming Language?
Before getting into computer programming, what is computer
programs and what they do. A computer program is a sequence
of instructions written using a Computer Programming Language
to perform a specified task by the computer.
• Sequence of instructions • Computer Programming Language

Let Look At The Below Analogy….


To understand the terms above: consider a situation when someone asks you
about how to go to a nearby KFC. What exactly do you do to tell him the way to go
to KFC? You will use Human Language to tell the way to go to KFC, something as
follows: First go straight, after half kilometer, take left from the red light and then
drive around one kilometer and you will find KFC at the right. Here, you have
used English Language to give several steps to be taken to reach KFC. If they are
followed in the following sequence, then you will reach KFC: 1. Go straight 2.
Drive half kilometer 3. Take left 4. Drive around one kilometer 5. Search for KFC
at your right side.
computer program instructions are also called program source code and
computer programming is also called program coding…
Now, try to map the situation with a computer program. The above sequence of instructions is
actually a Human Program written in English Language, which instructs on how to reach KFC
from a given starting point. This same sequence could have been given in Spanish, Hindi, Arabic,
or any other human language, provided the person seeking direction knows any of these
languages. Now, let's go back and try to understand a computer program, which is a sequence of
instructions written in a Computer Language to perform a specified task by the computer.
Following is a simple program written in Python Programming Language − print "Hello,
World!"
The above computer program instructs the computer to print "Hello, World!" on the computer
screen. A computer program is also called a computer software, which can range from two lines to
millions of lines of instructions
- python is the most simplest and readable of all oops
Definition: Computer programming is the process that professionals use to write code that
instructs how a computer, application or software program performs. At its most basic, computer
programming is a set of instructions to facilitate specific actions. A programming language is a
computer language that is used by programmers (developers) to communicate with computers. It
is a set of instructions written in any specific language to perform a specific task. It is made up of
a series of symbols that serves as a bridge that allow humans to translate our thoughts into
instructions computers can understand. Human and machines process information differently,
and programming languages are the key to bridging the gap between people and computers
therefore the first computer programming language was created.

-the unique advantage of C# over other object-oriented programming


languages is its strong integration with the .net framework, which provides a
comprehensive and unified development environment….
Language Comaparison by Feature

- Python is a high-level, interpreted programming language known for its readability and
simplicity. It supports multiple programming paradigms, including procedural, object-
oriented, and functional programming. Python is widely used for web development, data
analysis, artificial intelligence, scientific computing, and more. Its extensive standard
Language Comparison by Domain and Career goals

LISP
- (LISt Processing)
LISP is one of the oldest high-level programming languages, designed primarily for symbolic
computation and artificial intelligence research. It is known for its unique parenthetical syntax
and powerful macro system. LISP has influenced many later programming languages and is still
used in AI, academic research, and other specialized fields.
Language Comparison Paradigm, Generics,Type System and Execution strategy

-perl (practical extraction and report language)


perl is a high-level, interpreted language known for its powerful text processing
capabilities. it combines features from several other languages, making it versatile
f o r t a s k s l i k e s y s t e m a d m i n i s t r a t i o n , w e b d e v e l o p m e n t , n e t w o r k p r o gr a m m i n g, a n d
automation. perl's syntax can be complex, but it provides great flexibility and
support for regular expressions.
Language Comparison Paradigm, Generics,Type System and Execution strategy
In programming, the term "generic" refers to a feature that allows the creation of components (such as classes,
methods, or functions) that can work with any data type. This is done by using type parameters. Generics enable
you to write flexible and reusable code that can operate on different types without sacrificing type safety.
Here are a few key points about generics:
1. Type Parameters: Generics use type parameters, which are placeholders for the actual types that will be used. For example,
in a generic class, the type parameter can be replaced with any data type when an instance of the class is created.
2. Code Reusability: By using generics, you can create algorithms and data structures that are not limited to a specific type.
This increases code reusability and reduces the need for code duplication.
3. Type Safety: Generics provide compile-time type checking, which helps catch type errors early in the development process.
This ensures that your code is more robust and less prone to runtime errors.
E.g Java: Java introduced generics in JDK 1.5. An example is the ArrayList class, which can be used to store
elements of any type:

ArrayList<String> stringList = new ArrayList<>();

ArrayList<Integer> intList = new ArrayList<>();


Compile Time: Compile time refers to the phase of a program's execution when the source code is converted into machine
code or bytecode by the compiler. During this phase, the compiler performs syntax checking, type checking, optimization, and
generates the necessary executable code. Errors detected during compile time prevent the program from being successfully
compiled into an executable form.
Run Time: Run time, or runtime, is the phase when a program is executed. It starts after the compilation is completed and
the executable code is run by the operating system or virtual machine. During runtime, variables are initialized, methods are
invoked, and memory is allocated dynamically. Errors that occur at runtime are known as runtime errors or exceptions, which
can cause a program to terminate unexpectedly.
Type Erasure: Type erasure is a technique used in some programming languages, notably Java and C#, where type
information is erased at compile time and not available at runtime due to performance and backward compatibility reasons.
This means that generics and type parameters are used only during compilation to enforce type safety, but are replaced with
their bounding types (or objects) at runtime. This process allows for interoperability with legacy code and avoids overhead
associated with retaining type information at runtime.
-
ALGOL (ALGOrithmic Language)
ALGOL is a family of imperative programming languages originally developed in the mid-20th
century. It was influential in the development of many later languages, including C, Pascal, and
Ada. ALGOL introduced several important programming concepts, such as structured
programming, and was widely used in academic and scientific computing.
Classification of Programming Language Generation: Generations of computers have seen
changes based on evolving technologies. With each new generation, computer circuitry, size, and
parts have been miniaturized, the processing and speed doubled, memory got larger, and usability
and reliability improved. Note that the timeline specified for each generation is tentative and not
definite. The generations are actually based on evolving chip technology rather than any particular
time frame. The five generations of computers are characterized by the electrical current flowing
through the processing mechanisms listed below: • The first is within vacuum tubes •Second-
Transistors •Third- Integrated circuits •Fourth Microprocessors • Fifth-Artificial intelligence
associated with retaining type information at runtime.

-
Python has automatic garbage collection. It uses a technique called reference counting along with a cycle-detecting
garbage collector to manage memory. This means that Python automatically deallocates memory when objects are
no longer in use, which helps in managing memory efficiently without explicit memory management by the
programmer. Mention two other languages using garbage collectors..
First Generation 1GL:
- Machine-level programming language used to program first-generation.

- No translator was used to compile or assemble the first-generation language


- Binary machine code was used to program computers. (0s and 1s).
- Binary programming means that the program directly reflects the hardware
structure of the computer
- programming was done on the flip-flop level, Troublesome, cant solve complex
problems
-
In the context of programming languages, "generic" refers to the ability to write code that can operate on different
data types without being rewritten for each type. This is achieved through the use of "generics," which are a feature
that allows you to define functions, classes, methods, or data structures with placeholders for data types.
Second Generation 2GL:
- Assembly languages: the obvious drawbacks of binary programming became

smaller
- Allowed mnemonic abbreviations as symbolic names and the concept of
commands and operands was introduced
-A Programmer's work became much easier as symbolic notation and addressing of
instructions and data was now possible
- A Compilation system, called assemblers, were developed to translate the
assembly language/symbolic programs into machine code
-
A flip-flop is a digital logic circuit used in computers and other digital systems to store binary data. It is a type of
bistable multivibrator, meaning it has two stable states and can be used to store a single bit of information. Flip-
flops are fundamental building blocks in sequential logic circuits and are used for various purposes, such as data
storage, data transfer, and event detection. E.g SR (Set-Reset) Flip-Flop, D (Data or Delay) Flip-Flop:, JK Flip-
Flop and T (Toggle) Flip-Flop:.
Third Generation 3GL:
- Third generation languages /high level languages/Problem oriented languages:
- allow control structures which are based on logical data objects: variables of a
specific type

-provide a level of abstraction allowing machine-independent specification of data,


functions or processes, and their control.
- High level languages are grouped into: imperative, declarative, object oriented and
functional languages.

- Are designed to be more human-readable and to facilitate easier and more efficient
programming.

- Xtics
includes: High-level Abstraction, English-like Syntax,
Portability, Enhanced Productivity, Support For Structured
Programming And Error Handling
E.G includes: Fortran, Cobol, C, Pascal, Java and Python
Fourth Generation 4GL:
-Fourth generation languages/Non procedural languages deal database and query
languages, and program or application generators.
-increasing usage of software packages like database systems, spread sheets,
statistical packages, makes it necessary to have a medium of control available
-In 4GL the user describes what he wants to be solved, instead of how he wants to
solve a problem - as it is done using procedural languages.
- interactive programming environments. E.g. SQL: a query language for relational
databases based on Codd's requirements for nonprocedural query languages.
-NATURAL
F o u r t h - g e nemphasizing
e r a t i o n P r o g r aon
m ma i nstructured
g L a n g u a g e sprogramming
( 4 g l s ) A r e D e sstyle.
i g n e d Program
T o B e C l o sgenerators,
er To Human
Lbased
a n g u aon ge T specification
han Third-gen method
e r a t i o n and
L a n gproduce
u a g e s ( 3 ganl s ) .output
T h e y A r(e.g.
e Aim aehigh
d At Rlevel
e d u cprogram)
ing The
Complexity And Time Required To Develop Software By Providing Higher-level
Commands And Tools For Database Manipulation, Report Generation, And User
Interface Creation’ E.g sql (structured query language), matlab, sas (statistical
analysis system), abap (advanced busines, application programming), coldfusion and
powerbuilder
Fifth Generation 5GL:
-5GL is based around solving problems using constraints given to program rather
using an algorithm.
-5GL allows computers to have their own ability to think and their own inferences
can be worked out by using the programmed information in large databases.
-5GL gave birth to the dream of robot with AI and Fuzzy Logic.
-It is based on the concept of artificial intelligence.
-Rather than solving a problem algorithmically, an application can be built to solve
-it
based on some constraints, i.e., we make computers learn to solve any problem.
parallel processing & superconductors are used for this type of
language to make real artificial intelligence. advantages of this
generation is that machines can make decisions, it reduces
programmer effort to solve a problem and very easier than 3gl or 4gl
to learn and use. examples are: prolog, lisp, etc.

You might also like