Programming paradigms means a style, or "way" of programming
contrast declarative
The team descriptive programming is often used as an opposite to the imperative programming. Shortly speaking .
This paradigm allows you to declare WHAT you want to be done.this style of developing implies description of the logic of computation but not its control flow. By describing only the result the you want to get form the application , you can minimize unwanted side effects .Developers describe the results they want to get without explicit description of required steps
imperative paradigms
Imperative programming is probably the most widely spread paradigm, the most popular examples of imperative programming languages are C++ ,java and PHP .The main characteristics of such programming languages are direct assignments, common data structures, and global variables. Here's an example of the code written in C++ . It calculates factorial using recursion.
2. Discuss the difference between procedural programming and functional programming.
procedural programming
- The output of a routine does not always have a direct correlation with the input.
- Everything is done in a specific order.
- Execution of a routine may have side effects.
- Tends to emphasize implementing solutions in a linear fashion.
Functional programming
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.
- Often recursive.
- Always returns the same output for a given input.
- Order of evaluation is usually undefined.
- Must be stateless. i.e. No operation can have side effects.
- Good fit for parallel execution
- Tends to emphasize a divide and conquer approach.
- May have the feature of Lazy Evaluation.
Lambda calculus
Functional Programming - Lambda Calculus. 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
In computer programming, an anonymous function (function literal, lambda abstraction, or lambda expression) is a function definition that is not bound to an identifier. ... If the function is only used once, or a limited number of times, an anonymous function may be syntactically lighter than using a named function.
no side-effects
In computer science, an operation, function or expression is said to have a side effect if it modifies some state variable value outside its local environment, that is to say has an observable effect besides returning a value to the invoker of the operation.
referential transparency
Referential transparency is an oft-touted property of functional languages, which makes it easier to reason about the behavior of programs. I don't think there is any formal definition, but it usually means that an expression always evaluates to the same result in any context.
5. Discuss the key features of Object Oriented Programming.
The Object oriented programming is one of the newest and most powerful paradigms. The Object-Oriented Programming mentions to the programming methodology based on the objects, in its place of just procedures and functions. These objects are planned into classes, which are allowing to the individual objects to be group together. Modern programming languages containing java, PHP and C or C++ are object-oriented languages
There are three major features in object-oriented programming: encapsulation, inheritance and polymorphism . Encapsulation refers to the creation of self-contained modules that bind processing functions to the data.
Encapsulation- Hides the details of the implementation of an object
Abstraction- This is focuses on the essential characteristics of some object, relative to the perspective of the viewer
Polymorphism- Mechanism of wrapping the data (variables) and code acting on the data (methods) together as a single unit
In computer programming, event-driven programming is a programming paradigm in which the flow of the program is determined by events such as user actions , 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 ) that are centered on performing certain actions in response to user input.
Languages can be categorized according to the way they are processed and executed
Compiled languages
A compiled 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. Compiled 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.Example- BASIC, COBOL, CLEO
Scripting languages
A scripting language is a subset of programming language that is used to mediate between program in order to generate data. The main feature of scripting language is that it can guide other programs, much like a script that will give an actress their cue to start this part. It is a language that is meant to be interpreted , rather than compiled , emphasizing its purpose as a subset of all programming languages . Example - java , jsp , php
Markup languages
Markup language is not considered to be a programming language simply because the term is not well defined. A markup language is uses to control the presentation of the data, like representing structured data.For Example - HTML
8. Discuss the role of the virtual run time machines.
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. Their implementations may involve specialized hardware, software, or a combination.
9. Find how the JS code is executed (What is the run time? where do you find the interpreter?)
The source code is passed through a program called a compiler, which translates it into byte code 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.
Using html tags
ex:header tag
div tag
href tags
links
Doctype html
<html>
<head>
</head>
<body>
<h1>hello world</h1>
<h3> Ruwin Tharanga</h3>
</body>
</html>
Output
helloworld
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
Computer Aided Software Engineering (CASE) tools are used throughout the engineering life cycle of the software systems
CASE tools are set of software application programs, which are used to automate SDLC activities. CASE tools are used by software project managers, analysts and engineers to develop software system.
There are number of CASE tools available to simplify various stages of Software Development Life Cycle such as Analysis tools, Design tools, Project management tools, Database Management tools, Documentation tools are to name a few.
Use of CASE tools accelerates the development of project to produce desired result and helps to uncover flaws before moving ahead with next stage in software development.
12. Discuss the difference between framework, library, and plugin, giving some examples.
framework
Framework. A framework, or software framework, is a platform for developing software applications. It provides a foundation on which software developers can build programs for a specific platform. ... A framework may also include code libraries, a compiler, and other programs used in the software development process.
library
Libraries provide an API, the coder can use it
to develop some features, when writing code
At development time
•Add the library to the project (source code files,
modules, packages, executables)
•Call the necessary functions/methods using the
given packages/module/classes
At run time
•The library will be called by the code
plugin
Plugins are packages of code that extend the core functionality of WordPress. WordPress plugins are made up of PHP code and other assets such as images, CSS , and JavaScript.
No comments:
Post a Comment