Another example of how you can spend hours trying to understand an idea and get nowhere, but search for "intuitive+youridea" and rapidly find a gem like this example of the difference between functional and imperative programming. Within seconds of reading this I understood more than an hour of reading other articles on the same subject:
Imperative:... and so on and on ...
- Start
- Turn on your shoes size 9 1/2.
- Make room in your pocket to keep an array of keys.
- Put the keys in the room for the keys in the pocket.
- Enter garage.
- Open garage.
- Enter Car.
Declarative, whereof functional is a subcategory:
- Put the milk in the refrigerator.
- Stop.
... and so on and on ...
- Milk is a healthy drink, unless you have problems digesting lactose.
- Usually, one stores milk in a refrigerator.
- A refrigerator is a box that keeps the things in it cool.
- A store is a place where items are sold.
- By "selling" we mean the exchange of things for money.
- Also, the exchange of money for things is called "buying".
Make sure we have milk in the refrigerator (when we need it - for lazy functional languages).