/
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. 01.04.2023 at 11:27 am / Search Notes Fast: With Taskwarrior, jq & ripgrep
  3. 21.07.2021 at 07:46 am / Basis for Base64
  4. 03.07.2021 at 10:31 am / Learning Forever
  5. 07.04.2021 at 12:00 am / Harangued Commitments
  6. 13.02.2020 at 10:29 am / The Code Language Lawyers
  7. 29.08.2018 at 11:06 am / Damascus Differences
  8. 24.01.2016 at 12:00 am / Prayers Like Magic
  9. 28.09.2015 at 12:00 am / Mocking the Law - Excessive Judicial Discretion
  10. 26.08.2010 at 12:00 am /
© Wan Zafran. See disclaimer.