First page Back Continue Last page Graphics
...Procedural vs. Declarative Programming
Declarative
- tell taxi driver to "go to JFK Airport"
Procedural
- "Go straight for two blocks, make a right, proceed for three blocks, make a left, etc."
Notes:
As a analogy, consider the two ways one can give a taxi driver instructions to your destination, say, the JFK airport. The procedural way would give detailed instructions on how to get there such as: go straight for two blocks, make a right, proceed for three blocks, make a left, etc. The declarative way is to just ask the driver to take you to JFK and then leave it up to him to decide how to get there