this post was submitted on 26 Feb 2024
189 points (95.7% liked)

Programming

17666 readers
395 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 2 years ago
MODERATORS
 

As someone who spends time programming, I of course find myself in conversations with people who aren't as familiar with it. It doesn't happen all the time, but these discussions can lead to people coming up with some pretty wild misconceptions about what programming is and what programmers do.

  • I'm sure many of you have had similar experiences. So, I thought it would be interesting to ask.
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 27 points 10 months ago (1 children)

I found it useful when explaining programming to lay people to try to put various programming paradigms in everyday terms.

Imperative programming is like a cooking recipe. You need specific ingredients in certain amounts and you need to perform actions in a very specific order, or the recipe won't turn out right.

OOP is like a bicycle. Lots of pieces interconnected and working together, hopefully interchangeable and standardized. It can also be used to explain unit testing to juniors. Clock mechanisms or engines can also work but people tend to relate better to bicycles.

Declarative programming (SQL) works like ordering at the restaurant. You still need to know how restaurants work and about meal courses and how to read the menu etc. but you don't need to know how the sausage was made, only if it's good or not.

[–] [email protected] 16 points 9 months ago (1 children)

SELECT food FROM menu WHERE name LIKE 'Fried %';

[–] derpgon 7 points 9 months ago (2 children)

Lemme cat menu | grep Fried real quick

[–] [email protected] 8 points 9 months ago

You don't want to order from the cat menu.

[–] [email protected] 3 points 9 months ago (1 children)
[–] unhinge 7 points 9 months ago (1 children)
[–] [email protected] 4 points 9 months ago

Of course! It's amazing how this stuff just flows from the keyboard when you're typing in a shell window, but feels awkward when typing in a Lemmy comment.