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

Introduction to Programming Languages

The document outlines the Theory of Programming Languages course (CSC-161) at Mehran University, detailing its structure, prerequisites, and assessment methods. It introduces key concepts such as programming languages, types, paradigms, and fundamental programming constructs like functions, control flow, and error handling. The course aims to provide students with a comprehensive understanding of programming languages and their applications in computer science.

Uploaded by

zawars0005
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)
2 views

Introduction to Programming Languages

The document outlines the Theory of Programming Languages course (CSC-161) at Mehran University, detailing its structure, prerequisites, and assessment methods. It introduces key concepts such as programming languages, types, paradigms, and fundamental programming constructs like functions, control flow, and error handling. The course aims to provide students with a comprehensive understanding of programming languages and their applications in computer science.

Uploaded by

zawars0005
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/ 20

Theory of Programming Languages

(CSC-161)
Lecture # 01
Mr. Faizan Ali (Teaching
Assistant)

Department of Computer Systems Engineering,


BS in (Computer Science)
Mehran University of Engineering and Technology, Jamshoro.
Title of Subject: Theory of Programming Languages Code: CSC-161

Disciplines: BS Computer Science’24

Semester: 2nd Semester

Effective: 22 Batch and onwards

Pre-requisite: Computer Programming Concepts (CSC-102)

Quiz/Test 15% Assignment/Project/Presentation 15%

Mid-Semester, Exam: 30% Final-Semester, Exam: 40%

Credit Hours: TH: 03 PR: 00

Min. Contact Hours TH: 48 PR: 00

Min. Contact Hours TH: 100 PR: 00


Introduction to
Programming
Languages
Programming languages are used to communicate with computers
and instruct them to perform specific tasks. They provide a structured
way to write instructions that machines can understand and execute.
What is a Programming Language?
A programming language is a formal system that uses It acts as a bridge between human language and
syntax and rules to create instructions for a computer. machine language, allowing us to write programs that can
be understood by computers.
Types of Programming Languages
Procedural
Instructions are executed in a sequential order.

Object-Oriented
Programs are organized around objects that interact with each
other.
Functional
Emphasis on functions and their relationships.

Scripting
Used for automating tasks and creating interactive interfaces.
High-Level vs. Low-Level Languages
High-Level Low-Level

Closer to human language, easier to read and write. Closer to machine language, more difficult to read and
write but execute faster.
Compiled vs. Interpreted Languages
Compiled Interpreted

Code is translated into machine code all at once before Code is translated and executed line by line.
execution.
Object-Oriented Programming (OOP)
Encapsulation Inheritance Polymorphism
Data and methods are bundled Objects can inherit properties Objects can take on different
into objects, hiding internal and behaviors from parent forms or behaviors depending on
details. objects. the context.
Functional Programming
Immutability Pure Functions
Data cannot be changed Functions always return the
after it is created, same output given the
promoting predictable same input, without side
behavior. effects.

Higher-Order Functions
Functions can be passed as arguments to other functions or
returned as results.
Procedural Programming
Sequential Execution Data Structures
Instructions are executed in Data is organized into
a specific order. structures like arrays and
lists.

Subroutines
Code blocks can be reused multiple times.
Declarative Programming
Logic Rules Data Manipulation
Focuses on describing the Uses logic and constraints
desired outcome rather to transform and
than the specific steps to manipulate data.
achieve it.

Examples
SQL, Prolog
Scripting Languages
Rapid Prototyping Interpreted Execution
Quick and easy to create Code is translated and
scripts for automating executed line by line.
tasks.

Wide Use
Used for web development, system administration, and game
development.
Domain-Specific Languages
Specialized Purpose Simplified Syntax Examples
Designed for a particular domain Often use a simplified syntax HTML, CSS, SQL
or application, like web design or and vocabulary specific to the
financial modeling. domain.
Language Syntax and
Structure
Keywords Operators
Reserved words with Symbols that perform
specific meanings in the operations on data.
language.

Data Types
Categories of data like numbers, strings, and booleans.
Variables and Data Types
Variables Data Types
Containers for storing data, Determine the kind of data
named to make it easier to a variable can hold, such as
refer to it. integer, string, boolean, and
more.

Examples
Integer, string, boolean
Operators and Expressions
Operators Expressions Examples
Symbols that perform operations Combinations of variables, +, -, *, /, ==, !=
on data, such as arithmetic, operators, and constants that
logical, and relational operators. evaluate to a single value.
Control Flow Statements
Conditional Loops
Statements
Repeat a block of code
Execute different blocks of multiple times.
code based on conditions.

Examples
if-else, for, while
Functions and Subroutines
Reusable Code Parameters
Functions are blocks of code Functions can accept input
that perform a specific task parameters and return
and can be reused. output values.

Code Organization
Break down complex programs into smaller, manageable functions.
Debugging and Error
Handling
Finding and Fixing Error Handling
Errors
Code that handles
The process of identifying unexpected situations or
and correcting errors in errors during program
code. execution.

Examples
Try-catch blocks, debugging tools
Language Paradigms
Programming Styles Examples
Different approaches to Object-oriented, functional,
writing code, each with its procedural, declarative
own strengths and
weaknesses.

Choosing the Right Paradigm


Select a paradigm that best suits the problem being solved.

You might also like