Monday, 26 November 2018

Cs 508 Assignment 1 spring 2018


Question # 1:
By now you have studied that there are, literally, hundreds of programming languages that are used to solve computing problems, ranging from scientific, business, to artificial intelligence domains. These languages satisfy one or more programming paradigms or programming categories. Two of the most important categories are Imperative programming languages and Functional programming languages.
Describe briefly, the distinguishing features of Imperative and Functional programming language. Give at least two examples of both categories.
Answer:
Imperative Programming Languages:
What is Imperative Programming? Imperative Programming (IP) is one of the popular Programming Paradigms which executes a sequence of steps/instructions/statements in some order. Examples of IP Languages:- Java, C, C++ etc
Main Characteristics of Imperative Programming?
Any Imperative Programming (IP) Languages can contain the following Characteristics:
 Sequence of Statements.
 Order of execution of Statements is very important
. They contain state
. They use both Immutable and Mutable Data.
They can change state. They may have Side-effects.
Stateful Programming Model. They directly change the state of Program.
They represent state with Data Fields
Functional Programming Languages:
Question#2:
What is Functional Programming? In simple words, Functional Programming (FP) is one of the popular Programming paradigms, which does computation like Mathematical Functions without Changing State and Mutating Data. In Functional Programming, Functions are first class candidates. We write programs by defining a set of Functions and Immutable Data. Examples of FP Languages:- Scala, Haskell, Earlang etc are popular FP Languages. Java SE 8 also have some Functional Constructs.
The following concepts are major and important concepts of Functional Programming.
 First-Class Functions.
Lazy Evaluation.
 Higher-Order Functions. Immutability(Non-Mutable Data).
 Modularity.
No Side-effects.
 Lazy Evaluation.
Recursive Function-Calls
Java is one of the most popular programming languages in the market. According to TIOBE index, Java is at the top of the list (as of November 2018) in popularity among programming community:
You have to evaluate Java language on Reliability parameter. What two features/constructs in your opinion are available in Java which makes its code reliable for wide adaption in the industry?
Answer:
Security is an important aspect and Java’s security model is one of the key architectural features that make it most trustful choice.
java’s security model
Java’s security model is intended to help and protect users from hostile programs downloaded from some untrusted resource within a network through “sandbox”. It allows all the Java programs to run inside the sandbox only and prevents many activities from untrusted resources including reading or writing to the local disk, creating any new process or even loading any new dynamic library while calling a native method.


Exception handling concept
The concept of exception handling enables Java to capture a series of errors that helps developers to get rid of risk of crashing the system.

No comments:

Post a Comment