Introduction to The Frameworks
1. Compare and contrast declarative and
imperative paradigms?
Declarative>> a
programming paradigm that expresses the logic of a computation
without
describing its control flow
imperative>> a
programming paradigm that describes computation in terms of statements
that change a
program state
Declarative
|
imperative
|
No side effects
|
Many side effects
|
Express data flow
|
Control flow
|
No mutable variables
|
Mutable variable
|
The programmer specifies what is to be computed
|
The programmer specifies how this is to be computed
|
2. Discuss the difference between
procedural programming and functional programming?
Procedural programming is a programming paradigm, derived from structured programming[citation
needed], 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. Any given procedure might be called at
any point during a program's execution, including by other procedures or itself.
The first major procedural programming languages first appeared circa 1960,
including Fortran,
ALGOL, COBOL and BASIC.[1]
Pascal and C were published closer to the 1970s. Computer processors provide hardware support for procedural programming through a stack register and instructions for calling procedures and returning from them. Hardware support for other types of programming is possible, but no attempt was commercially successful
Functional
programming
The principles of modularity and
code reuse in practical functional languages are fundamentally the
same as in procedural languages, since they both stem from structured programming. So for example:
- Procedures correspond to functions. Both allow the reuse of the same code in various parts of the programs, and at various points of its execution.
- By the same token, procedure calls correspond to function application.
- Functions and their invocations are modularly separated from each other in the same manner, by the use of function arguments, return values and variable scopes.
The main difference between the
styles is that functional programming languages remove or at least deemphasize
the imperative elements of procedural programming. The feature set of
functional languages is therefore designed to support writing programs as much
as possible in terms of pure functions:
- Whereas procedural languages model execution of the program as a sequence of imperative commands that may implicitly alter shared state, functional programming languages model execution as the evaluation of complex expressions that only depend on each other in terms of arguments and return values. For this reason, functional programs can have a free order of code execution, and the languages may offer little control over the order in which various parts of the program are executed. (For example, the arguments to a procedure invocation in Scheme are executed in an arbitrary order.)
- Functional programming languages support (and heavily use) first-class functions, anonymous functions and closures, although these concepts are being included in newer procedural languages.
- Functional programming languages tend to rely on tail call optimization and higher-order functions instead of imperative looping constructs.
Many functional languages, however,
are in fact impurely functional and offer imperative/procedural constructs that
allow the programmer to write programs in procedural style, or in a combination
of both styles. It is common for input/output
code in functional languages to be written in a procedural style.
There do exist a few esoteric functional languages (like Unlambda) that
eschew structured programming precepts for the sake
of being difficult to program in (and therefore challenging). These languages
are the exception to the common ground between procedural and functional
languages
3. Explain the Lambda calculus and
Lambda expressions in functional programming?
a formal system in mathematical logic for expressing computation based
on function abstraction and application using variable binding and substitution
lambda
expressions:
expr
→ λ variable . expr | expr expr | variable | ( expr ) | constant
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
Absence of side effects is a necessary, but not
sufficient, condition for referential transparency. Referential transparency
means that an expression (such as a function call) can be replaced with its
value. This requires that the expression is pure,
that is to say the expression must be deterministic (always give the same value for the same input) and side-effect
free. A function without side effects can return different values according to
its history or its environment, for example if its output depends on the value
of a local static variable or a non-local variable respectively.
5.
Discuss the key
features of Object Oriented Programming?
Data Abstraction:Abstractions refer to the act of representing
essential features without including background details or explanation. They
are commonly known as Abstraction Data Type(ADT).
Encapsulation:The wrapping up of data and functions into single unit
is known as encapsulation. Data encapsulation is a striking feature of a
class. The data is not accessible to the outside world, and only those
functions which are wrapped in the class can access it. These functions provide
the interface between the object's data and the program.
Inheritance:Inheritance is the process by which objects of one
class acquire the properties of object of another class. The class whose
members are inherited is called the Base class and the class that inherits
those members is called Derived class. It supports class of hierarchical
classification.The concept of inheritance provides the ideas of reusability.
This means we can add essential features to an exciting class without modifying
it.
Polymorphism:Polymorphism is another OOP concept. Polymorphism
means the ability to take more than one form. An operation may exhibit
different behaviors at different instances.
6. How the
event-driven programming is different from other programming paradigms?
event-driven programming is a programming paradigm in which the flow of
the program is determined by events
such as user actions (mouse clicks, key presses), sensor outputs, or
messages
from other programs or threads. Event-driven programming is the
dominant paradigm used in graphical user interfaces and other
applications (e.g., JavaScript web
applications) that are centered on performing certain actions in response
to user
input. This is also true of programming for device
drivers
7.
Compare and
contrast the Compiled languages, Scripting languages, and Markup languages?
Compiled languages>> A complied language
is the proper and formal language that has been designed to allow programmers
to communicate instructions to a computer. Programming language is used to
create programs.Programming language is used to transform data by creating CPU
instruction that will rewrite the input data into the desired output. This is a
language that encodes programs, meaning that a word in the language can be
interpreted as a sequence of actions.
Markup language>>This is debatable, but
markup language is not considered to be a programming language simply because
the term is not well-defined. A markup language is used to control the
presentation of the data, like representing structured data. For example, HTML
is used to specify that some part of a document is a title, another part is a
list, another part is heading etc. So, based off of that, a markup language is
used to describe the data and the formatting in a textual format. There is a
general rule, that a markup language will not describe a process or an
algorithm (like programming language does) but is just pure data
With each of the differences being highlighted for all three languages, it must be understood that not one language is greater than the other, because they are all used interdependently help make the program itself run smoother.
8. Discuss the role of the virtual runtime machines?
a virtual
machine (VM) is an emulation of a computer system. Virtual machines are based
on computer architectures and provide functionality
of a physical computer. Their implementations may involve specialized hardware,
software, or a combination.
9. Find how the JS code is executed (What is the runtime?
where do you find the interpreter?)
The
source code is passed through a program called a compiler, which translates it
into bytecode that the machine understands and can execute. In contrast,
JavaScript has no compilation step. Instead, an interpreter in the browser
reads over the JavaScript code, interprets each line, and runs it.
10. Explain how the output of an HTML document is
rendered, indicating the tools used to display
the output?
HTML comments are visible to anyone
that views the page source code, but are
not rendered when the HTML document is
rendered by a browser. The "<!DOCTYPE html>" declaration is used
to inform a website visitor's browser that the document being rendered
is an HTML document.
11. Identify different types of
CASE tools, Workbenches, and
Environments for different types of
software systems (web- based systems, mobile systems, ioT systems,
etc.).? CASE tools fall into three categories: Upper CASE tools, Lower CASE tools and
Integrated CASE tools
Workbenches>>Collection
of tools that together support:
Process workflows (requirements,
design, etc.)
One or two activities where an
activity is a related collection of tasks
Commercial examples:
PowerBuilder
Software Through Pictures
Software Architect
12.
Discuss the difference between
framework, library, and plugin,
giving
some examples?
the difference between a framework and a
library as a framework. ... the simple answer is that the
distinguishing difference between a framework and the library
is who calls whom in other. words in a framework. the framework
code calls on your code and in a library.
The main difference between plugin
and library is that a plugin is an extension that improves the
capabilities of an application while a library is a collection of
classes and functions that helps to develop a software. A plugin is an
add-on for a software program that adds new functionality to it
The key difference between a library and a
framework is "Inversion of Control". When you call a method from a
library, you are in control. But with a framework, the control is inverted: the
framework calls you. A library is just a collection of class definitions. The reason behind is simply code reuse, i.e. get the code that has already been written by other developers. The classes and methods normally define specific operations in a domain specific area. For example, there are some libraries of mathematics which can let developer just call the function without redo the implementation of how an algorithm works.
In framework, all the control flow is already there, and there's a bunch of predefined white spots that you should fill out with your code. A framework is normally more complex. It defines a skeleton where the application defines its own features to fill out the skeleton. In this way, your code will be called by the framework when appropriately. The benefit is that developers do not need to worry about if a design is good or not, but just about implementing domain specific functions.
Comments
Post a Comment