Instructor: KMN1: Answer
Instructor: KMN1: Answer
Instructions:
• Answer the questions in the spaces provided or write in papers, scan and upload a single PDF file.
Answer:
a) Readability: Readability is one of the most important criteria for evaluating or judging a
programming language. Readability is the ease with which programs can be read and understood. Since
the readability of programs determines how easy they are to maintain, readability has become a key
metric for evaluating the quality of programs and programming languages.
b) Writability: Writability is a measure of how easily a language can be used to create programs for
chosen problem domains. It is the ease with which a programming language can be used to create
programs. The majority of the programming language factors or characteristics that influence
readability also influence writability. The factors or characteristic that influence writability are:
1) Simplicity and orthogonality
2) Support of abstraction
3) Expressivity
c) Reliability: A program is said to be reliable if it performs to its specifications under all conditions.
Reliability is conformance to specifications. The following characteristics have a significant impact on
reliability:
1) Type checking
2) Exception Handling
3) Aliasing
4) Readability and Writability
d) Orthogonality: In a programming language, Orthogonality means that a relatively small number of
primitive constructs be combined in a limited number of ways to build the control and data structures of
the language. Every possible combination of primitives is legal and significant. The lack of
orthogonality leads to exception to the rules of programming language.
Page 1 of 2
[CSE 325/425 - Midterm Assignment - Spring 2021 - SET A]
2. What are the differences between different programming language paradigms? [6]
Answer:
There are different kinds of major programming paradigms:
Imperative programming paradigm
Declarative programming paradigm
Functional programming paradigm
Object-oriented programming paradigm
The difference between different programming language paradigms:
Imperative Programming Paradigm:
1) Imperative programming is a programming paradigm that uses statements that change a
program's state.
2) Programs as statements that directly change computed state.
3) An imperative program consists of commands for the computer to perform.
4) Imperative programs describe the details of How the result are to be obtained.
Examples: C, C++, Java, PHP, Python, Ruby etc.
Declarative Programming Paradigm:
1) Declarative programming is a programming paradigm - a style of building the structure and
elements of computer programs that expresses the logic of a computation without describing
its control flow.
2) It defines program logic but not detailed control flow.
3) Declarative programming focuses on what the program should accomplish.
4) Computations as deductions in that logic space, and programs as theories of a formal logic.
Examples: SQL, XSQL, CSS etc.
Functional Programming Paradigm:
1) Functional programming is a subset of declarative programming.
2) It treats computation as the evaluation of mathematical functions avoiding state.
3) Programs written using this paradigm use functions, block of code intended to behave like
mathematical functions.
4) Functional programming paradigm based on lambda calculus.
Examples: F#, Haskell, Lisp, Python, JavaScript etc.
Object-oriented Programming (OOP) Paradigm:
1) Object-oriented programming is a programming paradigm based on the concept of object,
which can contain data and code: data in the form of fields known as attributes and code, in
the form of procedure known as methods.
2) OOP treats data fields as objects manipulated through predefined methods only.
3) The data of an object can be accessed only by the function associated with that object.
4) In OOP, computer programs are designed making them out of objects.
Examples: C++, Java, PHP, Python etc.
Page 2 of 2