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.
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.
An imperative programming language such as C# or Java allows you to specify step-by-step how a problem should be solved using a series of statements which change a program’s state.
other examples are : C, C++, Python.
you may also like difference between imperative and declarative programming .
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.
- A 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.
SELECT * FROM emp
where job='manager';
where job='manager';
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 imperative programming language such as C# or Java allows you to specify step-by-step how a problem should be solved using a series of statements which change a program’s state.
other examples are : C, C++, Python.
you may also like difference between imperative and declarative programming .
No comments: