/
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. 02.01.2024 at 08:16 pm / Go Interfaces - By Witcher-Like Metaphors
  2. 17.10.2022 at 12:31 pm / AI Art Is Real Art
  3. 20.08.2020 at 08:59 pm / A Case for Legalese (Or Not)
  4. 19.02.2020 at 10:25 am / STEM, STEAM and Art
  5. 07.10.2019 at 11:22 am / 3D & 2D - The Demarcation
  6. 30.12.2018 at 10:06 pm / Castles and Air
  7. 04.01.2018 at 12:00 am / Java Almost Requires An IDE
  8. 16.02.2014 at 12:00 am / Don't Care Too Much About Gear
  9. 14.08.2010 at 12:00 am / 百花繚乱
© Wan Zafran. See disclaimer.