728x90 AdSpace


Imperative and Declarative programming

Imperative and Declarative are programming paradigms.

A declarative programming  is a higher level programming language which allows you to express what you want without specifying how to get it.
  • Declarative programming is often defined as any style of programming that is not imperative.
  •  language with a clear correspondence to mathematical logic.
  • Declarative programming is a non-imperative style of programming in which programs describe their desired results without explicitly listing commands or steps that must be performed.Functional and logical programming  languages are characterized by a declarative programming style
Declarative programming is an common term that includes a number of better-known programming languages .Few of them are 
  • Constraint programming
  • Domain specific programming
  • functional programming
  • language programming
example: SQL is the best used declarative abstractions.In SQL we wont specify the whole logic.Just we will use commands like select. 

where job='manager';

 If it's just done the same query a second ago it might serve it from a cache almost instantly. By letting go of how we can get a whole host of benefits by letting computers do the hardwork, with little cognitive overhead.

Another place where declarative approaches are really powerful is in user interfaces, graphics and animations.(d3.js)

In imperative programming we tell the computer what to do.
  •  Imperative programming is a programming paradigm that describes computation in terms of statements that change a program state
  • Procedural programming is imperative programming in which the program is built from one or more procedures
An imper­a­tive pro­gram­ming lan­guage such as C# or Java allows you to spec­ify step-by-step how a prob­lem should be solved using a series of state­ments which change a program’s state.

other examples are :  C, C++, Python.

you may also like difference between imperative and declarative programming .
Imperative and Declarative programming Reviewed by tirupathi rao on 09:38 Rating: 5 Imperative and Declarative are  programming paradigms. A declarative programming  is a higher level programming language which allows you...

No comments: