Declerative vs Imperative Paradigms
Declarative programming is a programming paradigm that express the logic of a computation without describing its control flow.
Imperative programming is a programming paradigm that uses statements that change a program's state.
Difference between procedural programming and functional programming
Procedural programming uses a list of instructions to tell the computer what to do step by step.Procedural programming relies on procedures, also known as routines. A procedure contains a series of computational steps to be carries out. Procedural programming is also referred to as imperative or structured programming.
Procedural programming is intuitive in the sense that it is very similar to how you would expert a program to work. If you want a computer to do something, you should provide step-by-step instructions on how to do it. Many of the early programming languages are all procedural. Ex-: Fortran, COBOL, C
Common technique in procedural programming is to repeat a series of steps using Iteration.
Functional programming is an approach to problem solving that treats every computation as a mathematical function. The outputs of a function rely only on the values that are provided as input to the function and don't depend on a particular series of steps that precede the function.
Functional programming relies heavily on recursion.Examples for Functional programming are Erlang , Haskell, Lisp, Scala.
Procedural programming is intuitive in the sense that it is very similar to how you would expert a program to work. If you want a computer to do something, you should provide step-by-step instructions on how to do it. Many of the early programming languages are all procedural. Ex-: Fortran, COBOL, C
Common technique in procedural programming is to repeat a series of steps using Iteration.
Functional programming is an approach to problem solving that treats every computation as a mathematical function. The outputs of a function rely only on the values that are provided as input to the function and don't depend on a particular series of steps that precede the function.
Functional programming relies heavily on recursion.Examples for Functional programming are Erlang , Haskell, Lisp, Scala.
Lambda calculus and Lambda expressions in functional programming
Lambda calculus is a framework developed by Alonzo Church in 1930s to study computations with functions.
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.
Lambda expressions take advantage of parallel process capabilities of multi-core environments as seen with the support of pipeline operations on data in the Stream API. They are anonymous methods (methods without names) used to implement a method defined by a functional interface.
Referential transparency and no side effects in functional programming
In functional programming, referential transparency is generally defined as the fact that an expression, in a program, may be replaced by its value without changing the result of the program.
In functional programming, side effects are rarely used. The lack of side effects makes it easier to do formal verification's of a program.
In functional programming, side effects are rarely used. The lack of side effects makes it easier to do formal verification's of a program.
Key features of Object Oriented Programming
Key features of Object Oriented Programming are classes,objects, abstraction, encapsulation, information hiding, inheritance, polymorphism.
A class is the abstract definition of the data type. It includes the data elements that are part of the data
type, and the operations which are defined on the data type.
Objects are instances of classes, which we can use to store data and perform actions.
Abstraction is the process of removing characteristics from ‘something’ in order to reduce it to a set of essential characteristics that is needed for the particular system.
Encapsulation is the process of grouping related attributes and methods together, giving a name to the unit and providing an interface for outsiders to communicate with the unit.
Information Hiding ,hide certain information or implementation decision that are internal to the encapsulation structure ( class ).
Polymorphism is an object oriented programming concept that refers to the ability of a variable, function or object to take on multiple forms.
Inheritance enables new objects to take on the properties of existing objects. A class that is ised as the basis for inheritance is called a superclass or base class. A class that inherits from a superclass is called a subclass or derived class.
A class is the abstract definition of the data type. It includes the data elements that are part of the data
type, and the operations which are defined on the data type.
Objects are instances of classes, which we can use to store data and perform actions.
Abstraction is the process of removing characteristics from ‘something’ in order to reduce it to a set of essential characteristics that is needed for the particular system.
Encapsulation is the process of grouping related attributes and methods together, giving a name to the unit and providing an interface for outsiders to communicate with the unit.
Information Hiding ,hide certain information or implementation decision that are internal to the encapsulation structure ( class ).
Polymorphism is an object oriented programming concept that refers to the ability of a variable, function or object to take on multiple forms.
Inheritance enables new objects to take on the properties of existing objects. A class that is ised as the basis for inheritance is called a superclass or base class. A class that inherits from a superclass is called a subclass or derived class.
How the event-driven programming is different from other programming paradigms
Focus on the events triggered outside the system.
*User events (click, drag/drop, key-press,etc)
*Schedulers/timers
*Sensors, messages, hardware interrupts
Mostly related to the systems with GUIs , where the users can interact with the GUI elements.
Use event-listeners to act when the events are triggered.
An internal event loop is used to identify the events and then call the necessary handlers.
Can be seen as inversing the control to the event machine.
*User events (click, drag/drop, key-press,etc)
*Schedulers/timers
*Sensors, messages, hardware interrupts
Mostly related to the systems with GUIs , where the users can interact with the GUI elements.
Use event-listeners to act when the events are triggered.
An internal event loop is used to identify the events and then call the necessary handlers.
Can be seen as inversing the control to the event machine.
Compare and contrast the Compiled languages, Scripting languages, and Markup languages.
Compiled languages
*Some executables can be directly run on the OS (C on windows)
*Some executables use virtual runtime machines (JAVA, .NET)
Scripting languages
*Source code is not compiled, it is directly executed.
*At the execution time, the code is interpreted by a runtime machine.
Markup languages
*There is no execution process for the markup languages.
*The tools who have the knowledge to understand the markup languages can generate the output.
*Some executables can be directly run on the OS (C on windows)
*Some executables use virtual runtime machines (JAVA, .NET)
Scripting languages
*Source code is not compiled, it is directly executed.
*At the execution time, the code is interpreted by a runtime machine.
Markup languages
*The tools who have the knowledge to understand the markup languages can generate the output.
Role of virtual runtime machines
Virtualization limits costs by reducing the need for physical hardware systems. Virtual machines more efficiently use hardware, which lowers the quantities of hardware and associated maintenance costs, and reduces power and cooling demand. They also ease management because virtual hardware does not fail.
How the JS code is executed
The source code is passed through a program called a compiler, which translates it into bytecode that the machine uderstand, 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 run it.
How the output of an HTML document is rendered, indicating the tools used to display the output
Different types of CASE tools, Workbenches, and Environments for different types of software systems
CASE software different into 3 categories:
- Tools support specific tasks in the software life cycle.
- Workbenches combine two or more tools focused on a specific part of the software life-cycle.
- Environments combine two or more tools or workbenches and support the complete software life-cycle.
TOOLS:
CASE tools support specific tasks in the software development life-cycle. They can be divided into the following categories:
- Business and Analysis modeling. Graphical modeling tools. E.g., E/R modeling, object modeling, etc.
- Development. Design and construction phases of the life-cycle. Debugging environments. E.g.,GNU Debugger.
- Verification and validation. Analyze code and specifications for correctness, performance, etc.
- Configuration management. Control the check-in and check-out of repository objects and files.
- Metrics and measurement. Analyze code for complexity, molecularity performance, etc.
- Project management. Manage project plans, task assignments, scheduling.
WORKBENCHES:
Workbenches integrate two or more CASE tools and support specific software-process activities. Hence they achieve:
- a homogeneous and consistent interface (presentation integration).
- seamless integration of tools and tool chains (control and data integration).
An example workbench is Microsoft’s Visual Basic programming environment. It incorporates several development tools: a GUI builder, smart code editor, debugger, etc.
ENVIRONMENTS:
An environment is a collection of CASE tools or workbenches that attempts to support the complete software process. This contrasts with tools that focus on one specific task or a specific part of the life-cycle. CASE environments are classified by Fuggetta as follows:
- Toolkits
- Fourth generation
- Language-centered
- Integrated
- Process-centered
In practice, the distinction between workbenches and environments was flexible. Visual Basic for example was a programming workbench.
Difference between framework, plugin and library
A plugin extends the capabilities of a larger application. That sounds exactly like what your address book is doing. A library is a collection of subroutines or classes used to develop software. I think any component that instantiates its own database falls outside the scope of a library.
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. Both of them define an API that for programmers to use.
No comments:
Post a Comment