What is declarative programming?

Brian G picture Brian G · Sep 24, 2008 · Viewed 107.7k times · Source

I keep hearing this term tossed around in several different contexts. What is it?

Answer

1800 INFORMATION picture 1800 INFORMATION · Sep 24, 2008

Declarative programming is when you write your code in such a way that it describes what you want to do, and not how you want to do it. It is left up to the compiler to figure out the how.

Examples of declarative programming languages are SQL and Prolog.