this post was submitted on 27 Mar 2025
33 points (100.0% liked)

Out of the loop

12940 readers
2 users here now

A community that helps people stay up to date with things going on.

founded 2 years ago
MODERATORS
 

I've seen a couple posts in the top in the last 6 hours feed, and it seems like people are really up in arms about this functional programming stuff. Not really sure what it even is.

It looks like it's people writing bad programming or something? Like a lot of extra stuff that is not necessary?

EDIT: sorry everyone, I'm not a programmer and I don't know to much other than a little java and python. I guess I should have posted this in Explain Like I'm Five.

you are viewing a single comment's thread
view the rest of the comments
[–] dukeofdummies@lemmy.world 18 points 2 months ago (2 children)

Nah nah nah, it's just a different paradigm. It's like... it's a different meta, but for programming.

If I was to ELI5, I'd say it's the difference between making a series of objects that interact with each other (OOP) and and creating a very large console with lots of buttons (functional)

Some problems are much easier object oriented. If you have a video game, building a projectile class and adding different types of projectiles makes things suuuper easy to build. Arrows move slow and deal x damage, beams move super fast and deal y.

Functional can be easier to troubleshoot, also easier to crank out novel things, easier to make secure, and even make simultaneous operations trivial. It has very different problems though. You need to put more effort into eliminating dependencies.

The two do not play well together at all they're like fire and water. Sometimes you need water to soak something and make it easier to work, sometimes you need heat to melt something and make it easier to work.

Telecommunications like phones or military applications tend to the functional languages, data, video games, and a lot of the popular languages tend to OOP.

The transition between the two is jarring, and infuriating, but a knowledge of both can really improve your design skills.

[–] Melatonin@lemmy.dbzer0.com 7 points 2 months ago

You earn your name, Sir Duke.

[–] ravermeister@lemmy.rimkus.it 4 points 2 months ago* (last edited 2 months ago) (1 children)

In my opinion kotlin tries to slowly close the gap between functional and OOP programming. I love the implicit null checks, extension functions and the various list functions😊

[–] acockworkorange@mander.xyz 2 points 2 months ago

Dart also does that (importing fictional concepts), and treating functions as first class citizens opens up a lot of interesting options.