267
submitted 11 months ago by sirico@feddit.uk to c/programmerhumor@lemmy.ml
top 23 comments
sorted by: hot top controversial new old
[-] ImplyingImplications@lemmy.ca 53 points 11 months ago

In functional programming, everything is an expression (of frustration).

[-] fool@discuss.tchncs.de 34 points 11 months ago

Y=λf.(λ🤬.f(🤬🤬))(λ🤬.f(🤬🤬))

[-] tetris11@lemmy.ml 7 points 11 months ago* (last edited 11 months ago)
Y😄 = (λf.(λ🤬.f(🤬🤬))(λ🤬.f(🤬🤬)))😄
   = (λ🤬.😄(🤬🤬))(λ🤬.😄(🤬🤬))
   = 😄((λ🤬.😄(🤬🤬))(λ🤬.😄(🤬🤬)))
   = 😄(Y😄)
[-] yogthos@lemmy.ml 7 points 11 months ago

Having worked for nearly two decades in a functional language now, that's precisely how I feel about the imperative style.

[-] luciferofastora@lemmy.zip 6 points 11 months ago

In imperative style, everything is an instruction (to suffer)

[-] yogthos@lemmy.ml 3 points 11 months ago
[-] Kacarott@aussie.zone 40 points 11 months ago

If you are bored of writing Brainfuck in your spare time, try Lambda Calculus instead as an exciting alternative!

[-] 0x0@lemmy.dbzer0.com 16 points 11 months ago
[-] WILSOOON@programming.dev 2 points 11 months ago* (last edited 11 months ago)

Id rather cut of my limbs with a handsaw than touch lambda calculus again

[-] AdamBomb@lemmy.sdf.org 5 points 11 months ago

I’ve been there. It’s great!

[-] HStone32@lemmy.world 5 points 11 months ago

It would be extremely annoying to be forced to write all my code functionally.

But I find it even more annoying to be forced to write all my code object oriented. Looking at you, python and java.

[-] TimeSquirrel@kbin.melroy.org 9 points 11 months ago

C++. Do whatever the hell you want, it doesn't care. Mix paradigms all day long.

People complain about its complexity and the fact that it has everything including the kitchen sink, but that is exactly why I love it. It gives you choice.

[-] Chrobin@discuss.tchncs.de 6 points 11 months ago

C++: You can do everything, but with garbage syntax and ten traps to look out for™

[-] TimeSquirrel@kbin.melroy.org 4 points 11 months ago

Yes, look out for the leg bombs.

[-] HStone32@lemmy.world 4 points 11 months ago

If choice is our metric here, why not C? That way, you have the choice to use your own implementation of OOP

[-] Moc@lemmy.world 6 points 11 months ago

Bro just finds it annoying to write code

[-] HStone32@lemmy.world 3 points 11 months ago

Nah, coding is one of the few things I don't find annoying, so long as the language or toolsets I'm using allow for freedom. What I find annoying is when some talking head says all code should be a certain way, and everybody believes them for some reason.

[-] balsoft@lemmy.ml 1 points 10 months ago

What I find annoying is when some talking head says all code should be a certain way,

It's quite useful to have "all code be a certain way" within a language ecosystem. E.g. Haskell requiring all pure functions be actually pure is amazing because you know that any function from any library doesn't perform some stupid side effect when you call it, and just processes its inputs into an output. Of course, functional programming tools can be useful even outside purely functional languages, but having those important properties be ecosystem-wide makes you feel much more comfortable, and produces much better, safer and more reliable code in the end.

[-] expr@programming.dev 4 points 11 months ago* (last edited 11 months ago)

Unless you're writing Scala or something (which is probably the one exception to the rule), if you are using a language that supports OOP, you're not really doing functional programming. Functional-esque features that have made their way into imperative languages like map are only a tiny fraction of the functional toolbox.

There's a bunch of features you want in a language to do functional programming, and imperative languages don't really have them, like purity by default (and consequently, an orientation towards values rather than references) ergonomic function composition, algebraic data types, pattern matching, support for treating everything as first class expressions/values, etc.

Perhaps this is presumptious (and I apologize in advance if so), but I'd wager you haven't truly programmed in the functional paradigm. What imperative programmers tend to think of functional programming is very surface-level and not really reflective of what it actually is. It's an entirely different beast from imperative programming. It requires a shift of your mindset and how you think about programs as a whole.

Source: Senior software engineer writing Haskell full time for the last 4 years. Will avoid OOP until my dying breath.

[-] qjkxbmwvz@startrek.website 1 points 11 months ago

Not sure why you're saying Python forces everything to be object oriented...?

[-] expr@programming.dev 3 points 11 months ago

It basically does. It pretends to court functional programming while actually being really antithetical to it in basically every way. Guido Van Rossum has vocally expressed his dislike for functional programming (though I'd argue he actually doesn't really know much about it).

[-] devfuuu@lemmy.world 2 points 11 months ago

But how many burritos is that.

[-] sirico@feddit.uk 5 points 11 months ago

But how many burritos is that.

Lets find out! Count = λB. (B (λx. (x + 1)) 0)

3 its 3 burriotos you're going to have to pop out and get 8 more for the other commenters

this post was submitted on 16 Jan 2025
267 points (95.9% liked)

Programmer Humor

39486 readers
73 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS