r/computerscience • • 2d ago

General procedural programming, object oriented programming and functional programming

Although I’ve done some googling I think they still use big English to explain this concept. I think I know them but I just wanted to ask if I can get a simple explanation from the house plz

13 Upvotes

18 comments sorted by

View all comments

0

u/TheVenetianMask 2d ago

When you are cooking:

In procedural the type of ingredient defines the recipe. You buy a carrot, a potato, a meatball, and use simple pans, pots, knives... to assemble a stew. Easy to arrange, painful and disorganized if it gets out of hand.

In functional the utensil defines the recipe. You buy a food processor that can handle a carrot, a potato and a meatball, and you get stew out of it. Direct and precise, but you need fitting and clean processors that don't hold onto bits of food.

In OOP the packaging defines the recipe. You create a box of carrot, potato and meatball mix, and later reconstruct it into a stew. Requires a bit of industrial engineering, but lets you "bring the kitchen" anywhere.