/
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

Filed under:
#
Words: 95 words approx.
Time to read: 0.38 mins (at 250 wpm)
Keywords:
, , , , , , , , ,

Other suggested posts

  1. 15.10.2023 at 01:01 pm / Sunset-Rowing Witchers
  2. 30.04.2022 at 10:36 am / Masters of A Fraction of A Dot
  3. 12.02.2021 at 12:55 am / 46 Simple Python Exercises/#10
  4. 16.12.2017 at 12:00 am / When Defying Simplicity
  5. 09.07.2016 at 12:00 am / The Lawgiving Coder
  6. 03.01.2014 at 12:00 am / Write With Vigour
  7. 21.07.2012 at 12:00 am / Hunted By GLaDoS
  8. 26.03.2012 at 12:00 am / Apricot Orange Sunsets
  9. 15.08.2010 at 12:00 am / 海老
  10. 14.08.2010 at 12:00 am / Basic Kanji Learning Principles
© Wan Zafran. See disclaimer.