1. Compare and contrast declarative and
imperative paradigms
Declarative
paradigm means that express the logic of computation without describing its
control flow. In simply we can clarify it as, when we ask for a friend to draw
a landscape you don’t care how they draw it, that’s up to them. Further we can
describe this as this implies the logic of computation but not it’s control
flow. We can minimize the unwanted side effects by just describing only the
result that you want to get from the application.
This
imperative paradigm are much simpler to understand and much safer to use. It’s
more scable & provides you with the possibility to reuse the code. Many declarative
implementation have some sort of imperative abstraction layer.
Imperative
paradigm means paradigm that uses statements that a program’s state. This is
like when we ask for one of our friend to draw a landscape, we are providing
them with the steps in order to get the desired result.
This is the
most widely spread paradigm. The most popular example of implementation
programming language are C++,java & PHP. Sometimes this may seem like too
complicated and also this more error
prone than declarative programming language.
2. Discuss the difference between procedural
programming and functional programming
Functional programming is a programming paradigm , a
style of building the structure and elements of computer programs that treats
computation as the evaluation of mathematical functions and avoids
changing-state and mutable data.
Functional
programming is about passing data from
function to function to function to get a result. In here, functions are
treated as data, meaning you can use them as parameters, return them, build
functions from other functions, and build custom functions. Functions in Functional
programming have to be pure functions, they should avoid shared state, and side
effects and data should be immutable.
Procedural
programming is a programming paradigm, derived from structured
programming, based upon the concept of the procedure call. Procedures, also known as routines, subroutines, or
functions, simply contain a series of computational steps to be carried out. Procedural programming also known as inline programming takes a
top-down approach. It is about writing a list of instructions to tell the
computer what to do step by step. It relies on procedures or routines.
3. Explain the Lambda calculus and Lambda
expressions in functional programming.
Lambda
calculus is a framework developed by Alonzo Church in 1930's to study
computations with functions. Lambda calculus is a theoretical math
which you can read on and understand without fluently know your timetable. Higher
math is more about concepts and abstractions than number operations.
Lambda calculus
includes three different types of expressions,
E ::
= (variables)
| E1 E2 (function application)
| λx.E (function creation)
Where λx.E is
called Lambda abstraction and E is known as λ-expressions.
Here if we clarify
more the above ,
Function creation − Church introduced the notation λx.E to
denote a function in which ‘x’ is a formal argument and ‘E’ is the functional
body. These functions can be of without names and single arguments.
Function application − Church used the notation E1.E2 to
denote the application of function E1 to actual argument E2.
And all the functions are on single argument.
4. What is meant by “no
side-effects” and “referential transparency” in functional programming?
Functional programming is based on the simple
premise that your functions should not have side effects, they are
considered evil in this paradigm. If a function has side effects we call
it a procedure, so functions do not have side effects. We consider that a
function has a side effect if it modifies a mutable data structure or variable,
uses IO, throws an exception or halts an error, all of these things are
considered side effects. The reason why side effects are bad is because, if you
had them, a function can be unpredictable depending on the state of the system.
When a function has no side effects we can execute it anytime, it will always
return the same result, given the same input.
Side effects
are needed because without them our programs will do only calculations. They
should be required for the required limit. We often have to write to databases,
integrate with external systems or write files.
Referential transparency is an oft-touted
property of(pure)functional languages, which makes it easier to reason about
the behavior of programs. A function that returns always the same result
for the same input is called a pure function. A pure function, therefore, is a
function with no observable side effects, if there are any side effects on a
function the evaluation could return different results even if we invoke it
with the same arguments. We can substitute a pure function with its calculated
value.
5.
Discuss the key features of Object Oriented Programming.
Object Oriented
Programming is a method of implementation in which programs are organized as a
collection of objects which co-operate to solve a problem. Allows to solve more
complex problems easily. Key features of OOP are object & class,
inheritance, abstraction, polymorphism, encapsulation.
Any entity that has state and behavior is known as an
object. It can be physical or logical. An Object can be defined as an instance
of a class. An object contains an address and takes up some space in memory.
Objects can communicate without knowing the details of each other's data or
code. The only necessary thing is the type of message accepted and the type of
response returned by the objects.
Collection of object is called class. It is a logical
entity. A class can also be defined as a blueprint from which you can create an
individual object. Class doesn't consume any space. When one object acquires all the properties and behaviors of a parent object,
it is known as inheritance. It provides code reusability. It is used to achieve
runtime polymorphism.
If one task is performed by different ways, it is
known as polymorphism. For example: if we want to drop someone a message we can
have many forms to perform that task as dropping a text message, having a voice
message etc. In Java, we use method overloading and method overriding to
achieve polymorphism.
Binding or
wrapping code and data together into a single unit are known as encapsulation. For
example capsule, it is wrapped with different medicines. A java class is the example
of encapsulation. Java bean is the fully encapsulated class because all the
data members are private here.
6. How the event-driven
programming is different from other programming paradigms?
An event-driven program is one that largely responds
to user events or other similar input. Event driven programs generally have 2
important structures : an event loop for capturing and handling events various
sources and closures to handle the dispatched events. Other programming
languages may feature user events that are largely delivered through a
command-line interface or some other type of user interface. The opposite of
event-driven programming would be programming that is written to act regardless
of user input.
For a example display apps such as those for weather
updates or scores may feature less of the event-driven programming that is
inherent in other kinds of programs. However, nearly all software relies on
user events for functionality and it would be easy to argue that event-driven programming is the default for
nearly all kinds of projects.
7. Compare and contrast the Compiled languages,
Scripting languages, and Markup languages.
| Compiled languages |
Scripting languages |
Markup languages |
| These are the languages which are compile separately
and run that code even if successful complication or it may display an error
message |
These are the languages that are not complied, more
like interpreted at run-time. |
These are the languages that are not in any way
executed or used to perform actions but they are used to structure data,
identify data or present data as the case may be. |
| Java, C, C++ |
Javascript, VB script python, PHP |
HTML, XML |
8. Discuss the role of the virtual
runtime machines
Virtual
machine is a simple software program which simulates the function of a physical
machine. In computing, a virtual machine is an emulation of a
computer system. Virtual machines are based on computer architectures and
provide functionality of a physical computer.
There are
two kinds of virtual machines, each with different functions:
*System
virtual machines - provide a substitute
for a real machine. They provide functionality needed to execute entire operating
system.
*Process
virtual machines are designed to execute computer programs in a
platform-independent environment.
9. Find how the JS code is
executed (What is the runtime? where do you find the interpreter?)
Use JS Bin for running
JS or save file as .HTML, .HTM and open in google chrome, right click inspect
element and click console. Then onwards you should be able to see the results
of your code running. If you don’t want to use JS Bin, install Node, a light-weight
server that will allow you to run your Javascript code in the command line
console with the ability to just do ‘node’+name of file .js
10. Explain how the output of an HTML document
is rendered, indicating the tools used to display the output.
Step1: Open the notepad
Open Start > Programs
> Accessories > Notepad
Step 2: Write the relevant HTML code
Step 3: Save the HTML page as .html
Step 4: View the HTML page in your
browser
11. Identify different types of CASE tools,
Workbenches, and Environments for different types of software systems
(web-based systems, mobile systems, IoT systems, etc.).
Tools - support individual process tasks such as
checking the consistency of a design, compiling a program, comparing test
results, etc. Tools may be general-purpose, stand-alone tools (e.g. a
word-processor) or may be grouped into workbenches.
1. Life-cycle
support
2. Integration
dimension
3. Construction
dimension
4. Knowledge-based
CASE dimension
Workbenches - support process phases or activities
such as specification, design, etc. They normally consist of a set of tools
with some greater or lesser degree of integration.
1. Business
planning and modeling
2. Analysis
and design
3. User-interface
development
4. Programming
5. Verification
and validation
6. Maintenance
and reverse engineering
7. Configuration
management
8. Project
management
Environment - support all or at least a
substantial part of the software process. They normally include several
different integrated workbenches.
1. Toolkits
2. Language-centered
3. Integrated
4. Fourth
generation
5. Process-centered
12. Discuss the difference between framework, library,
and plugin, giving some examples
Plugins provide specific tools for
development.
At development time
|
At runtime
|
The plugin is placed in the project
|
The plugin will be invoked via the
configurations
|
Libraries provide and API the coder
can use it to develop some features, when writing code.
At development time
|
At runtime
|
Add the library to the project
|
The library will be called by the code
|
Call the necessary function/methods using
the given module/classes
|

No comments:
Post a Comment