/
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. 03.07.2022 at 05:15 pm / The Unpreparedness Apology
  2. 30.04.2022 at 10:36 am / Masters of A Fraction of A Dot
  3. 13.08.2020 at 10:00 am / Consenting Pythonic Adults
  4. 19.02.2020 at 10:25 am / STEM, STEAM and Art
  5. 12.07.2016 at 12:00 am / Refunctin' Blocks
  6. 06.10.2015 at 08:02 am / Subservient/Servile Written Malay
  7. 30.11.2013 at 12:00 am / Particle Oranges
  8. 28.11.2013 at 12:00 am / ケチ - Scroogean Niggardliness
  9. 08.11.2013 at 12:00 am / Red Riding Hood's Examination-in-Chief
  10. 14.04.2012 at 12:00 am / Ghostly Portal
© Wan Zafran. See disclaimer.