Thursday, February 14, 2019

Introduction to the Frameworks.

1. Compare and contrast declarative and imperative paradigms. 

Declarative Programming :

Its a programming paradigm that expresses the logic of a computation without describing its control flow. Simply What to do.

Ex : small_nums = [x for x in range(20) if x < 5]

Imperative Paradigm :

Its a programming paradigm that describes computation in terms of statements that change a program state. Specifies both What to do & How to Do.

Ex :
          small_nums = []
    for i in range(20):
    if i < 5:
        small_nums.append(i)



2. Discuss the difference between procedural programming and functional programming.  

Functional Programming :

It is a programming paradigm a style of building the structure and building the structure and elements of computer programs. Its treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data.

Procedural Programming :

Its a programming paradigm derived from the structured programming , based in the concept of the procedure calls. Its similar to functions.

Brief Explanation in below video :





3. Explain the Lambda calculus and Lambda expressions in functional programming.  

Lambda Expressions are the essential blocks of code that can be assigned to variables, passed as an argument, or returned from a function call. In programming languages its support high-order functions.

Lambda Calculus is conceptually the simplest programming method. Its have to be a function and it should take only one argument. also Its should return a value.


4. What is meant by “no side-effects” and “referential transparency” in functional programming?

In Functional Programming our functions should not have side effects. They considered as evil in this paradigm. So functions do not have side effects. A function has side effect if it modifies a mutable data structure or variable uses 10, throws an exception; all of these considered as 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 function has no side effects we can execute it anytime.

The ability is to replace an expression with its calculated value is called referential transparency. Its allow us to substitute expressions with values. The property enables us to thing and reason abotu the program evaluation using the substitution model.


5. Discuss the key features of Object Oriented Programming.

The Object Oriented Programming language supports all the features of normal programming languages. In addition it supports some important concepts and terminology as well.
  • Inheritance
  • Polymorphism
  • Abstraction
  • Data Hiding
  • Encapsulation
  • Overloading
  • Reusability
  • Classes
  • Objects

Inheritance

When one object acquires all the properties and behaviors of a parent object, it is known as inheritance. Its provides code reusability. Its is used ti achieve a runtime polymorphism.


Polymorphism

If one task is performed by different ways, it is known as polymorphism. Polymorphism means multiple forms.  For Example to convince the customer differently to draw something like shape, triangle, rectancle.

Abstraction

Hiding internal details and showing functionality is known as abstraction. For Example Phone call, we dont know the internal processing.

Enscapsulation

Binding code and data together into a single unit are know as Encapsulation. For example Capsule, Its wrapped with the different medicines.


6. How the event-driven programming is different from other programming paradigms? 

Event-driven programming is a programming paradigm which the flow of program execution is determined by events. An event-driven application is designed to detect events as they occur, and then deal with them using an appropirate event handling process.

Ex : A user action such as onKeyPressed or Mouse Click  or another program.


7. Compare and contrast the Compiled languages, Scripting languages, and Markup languages.

A Markup language is a language which is used to represent structured data. For example, HTML enables to specify that some part of the document is title or some other part is a list by comparision to a flat text document. Also Markup languages are not considered as a programming languages.

Ex : HTML, XML, FXML

A Scripting language is a programming language which is interpreted, rather than compiled, which means that scripting languages represent a subset of all programming languages. Scripting Language actually does call another program or instructions to the job to be done.

Ex : JavaScript, Python, PHP

Compiled Languages are generally run faster than scripting languages because scripting languages must be reduced to machine instructions at runtime. With an interpreted language you can do things that cannot be done in a compiled language.

Ex : C


8. Discuss the role of the virtual runtime machines. 

Virtual Macines is an emulation of a computer system. Virtual machines are based on computer architectures and provide functions of a physical computer. Its 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?) 

JavaScript is what is called a called a Client Side Scripting Language. That means that it is a computer programming language that runs inside Internet Browser. The way JavaScript works is inside the normal webpage we place some javascript code. When the browser loads the page, the browser has a built-in interpreter that reads the JavaScript code it finds in the page and runs it.


10. Explain how the output of an HTML document is rendered, indicating the tools used to display the output.  

HTML consists of a series of codes typed into a text-file by the site author. The text should be saved as .html file only can view the output through the browsers like Internet Explorer , Google Chrome and Mozilla Firefox. This browsers reads the file and translate the text into a visible form, hopefully rendering the page as the author had intended.


12. Discuss the difference between framework, library, and plugin, giving some examples.   

A library is just a collection of class definitions. the reason behind is simple cod reuse that has already been written by other developers. The classes and methods normally defines specific operations in a specific area. For example, There are some libraries of mathematics which can let developer just call the function without redo the implementation.

In a framework, all the control flow is already there. A Framework normally more complex. Its defines a skeleton where the applications defines its own features to fill out the skeleton. In this way we have to write our code. The code will be called by the framework.

Library Examples : Jasper, Jfoenix
Framework Examples : Laravel, Angular, React

No comments:

Post a Comment