/
03.12.2017 at 12:00 am
Cuttings

Declarative, Imperative, Functional Sandwiches

Programming paradigms and sandwiches.

... Declarative programming says, "Make me a sandwich."

Imperative programming says, "Get peanut butter. Get a knife. Get bread. Scoop peanut butter using the knife. Spread peanut butter knife over bread."

Functional programming says (and here the analogy breaks down a little), "Transform a closed jar of peanut butter into an open jar of peanut butter. Transform the open jar of peanut butter and a knife into a knife with peanut butter on it. Transform the knife and a slice of bread into a sandwich."

- Reddit
Source: Reddit
Filed under:
#
Words: 8 words approx.
Time to read: 0.03 mins (at 250 wpm)
Keywords:
, , , , ,

Other suggested posts

  1. 04.07.2024 at 08:43 am / Chronic Key Switching
  2. 15.06.2022 at 01:04 am / Prepackaged Thought Cassettes
  3. 11.06.2022 at 07:24 am / Vampiric Pathology
  4. 04.06.2020 at 09:43 am / A Traveling Minstrel's Piano
  5. 06.09.2015 at 12:00 am / Big Illegal Guns
  6. 20.06.2015 at 12:00 am / Mike Tyson on (His) Lawyers
  7. 14.04.2012 at 12:00 am / Ghostly Portal
  8. 17.03.2012 at 12:00 am / Upper and Lower Hengsha
  9. 16.08.2010 at 12:00 am / You Have Reason
  10. 15.08.2010 at 12:00 am / 海老
© Wan Zafran. See disclaimer.