/
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. 12.02.2021 at 12:55 am / 46 Simple Python Exercises/#10
  2. 22.08.2020 at 05:49 pm / Decoding Code Specimens
  3. 29.01.2020 at 10:48 am / Code & Shame
  4. 14.09.2019 at 12:00 am / Narratives Hold
  5. 23.06.2019 at 10:59 am / Mood-Clustered Compositions
  6. 31.12.2018 at 06:23 pm / Why Plain Text
  7. 17.12.2017 at 12:00 am / To Know C
  8. 12.12.2017 at 12:00 am / Innocent Until Proven Guilty
  9. 12.06.2015 at 12:00 am / He Conquers Who Endures
  10. 11.11.2013 at 12:00 am / 下戸 - Lower House
© Wan Zafran. See disclaimer.