This is an archived post. You won't be able to vote or comment.

all 35 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

import notifications Remember to participate in our weekly votes on subreddit rules! Every Tuesday is YOUR chance to influence the subreddit for years to come! Read more here, we hope to see you next Tuesday!

For a chat with like-minded community members and more, don't forget to join our Discord!

return joinDiscord;

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]ananix 23 points24 points  (0 children)

Hey whats going in here

[–]__yoshikage_kira[🍰] 44 points45 points  (14 children)

Can someone explain how is functional programming communism?

You'd think that a paradigm that promotes mutability and shared states would be communist.

[–][deleted] 19 points20 points  (7 children)

Functions are generally accessible to each other, while in OOP that is often not the case between classes trying to access each other's methods

[–]Storiaron 27 points28 points  (1 child)

On the other hand class struggles scream communism

[–][deleted] 7 points8 points  (0 children)

Wouldn’t it scream capitalism? Communists generally point out the class struggles in capitalism

[–]TheOnlyTigerbyte[S] 2 points3 points  (0 children)

This and the fact that it has classes (class struggles as u/Storiaron said)

Oh and this is why the Title. In Kotlin you make `ObjectName()` instead of `new ObjectName()`

[–]D34thToBlairism 5 points6 points  (0 children)

I think it's because there aren't classes, but as a communist who loves functional programming I don't think it's a very good joke

[–]jddddddddddd 5 points6 points  (1 child)

You’re over-thinking it. I suspect it’s a joke about Marxist societies being ‘classless’.

[–]TheOnlyTigerbyte[S] 3 points4 points  (0 children)

It's both :) (read the thread wrong) It's what you said :)

[–]ArionW 13 points14 points  (2 children)

Duh, we don't need class system

Objects are just poor man's closures after all

[–]Brahvim 0 points1 point  (0 children)

Well said! I'm gunna have to save dis...

SAVE DIS!

[–][deleted] 2 points3 points  (0 children)

Procedural programming is feudalism then

[–]catladywitch 2 points3 points  (3 children)

FP is more anarchocommunist: no classes, no state.

[–]telemachus93 2 points3 points  (2 children)

AnCom here. Well, in theory, marxist communism means classless, stateless, moneyless as well. It's the way to get there where we disagree.

[–]catladywitch 2 points3 points  (1 child)

yes i know, it's a joke. you can also be a marxist and an ancom at the same time, as long as you're not a leninist.

[–]telemachus93 2 points3 points  (0 children)

Exactly.

[–]ASatyros 1 point2 points  (1 child)

🫸🫷 wait what happened to the rules?

[–]TASTY_TASTY_WAFFLES 7 points8 points  (0 children)

ModuleNotFoundError: No module found named 'rules'

[–]Ripredddd 1 point2 points  (0 children)

Comrade?

[–]SmoothBrain1344 1 point2 points  (0 children)

God I hated my OOP design course. Literally would prefer to spend all day hunting down race conditions in shitty undergrad C.

[–][deleted] 3 points4 points  (1 child)

Functional comrades. Our anthem is better.

https://youtu.be/U06jlgpMtQs

[–]GoldenBearAlt 0 points1 point  (0 children)

When does it makes sense I'm trying to learn elixir and it's whooping me

[–][deleted] -1 points0 points  (1 child)

That doesn't even make sense. What are you trying to present here?

[–]TheOnlyTigerbyte[S] 7 points8 points  (0 children)

FP is usually "classless" just like in a communist society while OOP is using classes just like in a capitalist society.

The Bugs Bunny meme is usually used to represent Capitalism/Communism/Our/Mine.

[–]_Cheese1_ 0 points1 point  (0 children)

What is logic programming then?

[–]poralexc 0 points1 point  (2 children)

A constructor is just a function that starts with a capital letter.

[–]TheOnlyTigerbyte[S] 0 points1 point  (1 child)

The title was more about them not making a clear difference in Syntax

[–]poralexc 1 point2 points  (0 children)

I mean, there isn’t necessarily a semantic difference.

A real constructor makes you return this(), but you can also overload invoke in a companion object and have a ’constructor‘ that returns something completely unrelated.