this post was submitted on 21 Mar 2024
297 points (95.1% liked)

Programmer Humor

19623 readers
84 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] loxdogs 11 points 8 months ago (7 children)

can someone explain please?

[–] [email protected] 29 points 8 months ago (6 children)

In functional programming, everything is seen as a mathematical function, which means for a given input there is a given output and there can be no side effects. Changing a variable's value is considered a side effect and is thus not possible in pure functional programming. To work around this, you typically see a lot of recursive and higher order functions.

Declaring all values as const values is something you would do if you're a diehard functional programmer, as you won't mutate any values anyway.

[–] loxdogs 4 points 8 months ago

thanks, kinda understand

load more comments (5 replies)
load more comments (5 replies)