IT Knowledge Support Centre
Imperative vs Declarative languages 
Wednesday, October 21, 2009, 04:59 PM - General
Posted by Administrator
The imperative language model requires the user to determine what the end result should be and also tell the computer step by step how to achieve that result.
It is analogous to asking a cab driver to drive you to the airport and then giving him turn by turn directions to get there.
SQL is different from many common programming languages such as c++ and visual basic because it is a declarative language. Languages such as c++, visual basic, c# and even assembler are imperative languages.

Declarative languages such as SQL, on the other hand let you frame problems in terms of the end result. All you have to do is describe what you want from SQL
Server via a query and trust the database engine to deliver the correct result as efficiently as possible. To continue the cab driver analogy from earlier, in a declarative language you would tell the cab driver to take you to the airport and then trust that he knows the best route.
add comment ( 1 view )   |  permalink   |   ( 3.1 / 298 )

<Back | 1 | Next> Last>>