this post was submitted on 19 Apr 2024
513 points (98.1% liked)

Programmer Humor

19197 readers
986 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
[–] krewjew@lemmy.world 32 points 5 months ago (17 children)

I’ve been learning Haskell, and now I won’t shut up about Haskell

[–] affiliate@lemmy.world 2 points 5 months ago (13 children)

what's the appeal of haskell? (this is a genuine question.) i've been a bit curious about it for a while but haven't really found the motivation to take a closer look at it.

[–] pkill@programming.dev 8 points 5 months ago* (last edited 5 months ago) (1 children)

purely functional paradigm (immutable data structures and no shared state, which is great for e.g. concurrency) and advanced type system (for example you could have linear types that can be only used once). Lisps build on the premise that everything is data, leaving little room for bloated data structures or tight coupling with call chains that are hard to maintain or test. In Haskell on the other hand, everything is a computation, hence why writing it feels more like writing mathematical equations than computer programs somehow. It might, along Scala be good for data-driven applications.
Also the purely functional syntax means that on average, functional programming languages will arrive at the same solution in approx. 4 times less LOC than procedural/OO according to some research. Just look at solutions to competetive programming problems.
And even though I'm not a big fan of opinionated frameworks, compare some Phoenix codebase to a Symfony or even a Rails one to see how much cleaner the code is.

But if you're new to FP you should rather pick Scheme, Elixir or Clojure since the paradigm itself can be a little bit hard enough to wrap your head around at first (though Elixir and is a bit imperative, depends on how deep are you ready to dive in), not to mention having to learn about ADTs and category theory.

[–] krewjew@lemmy.world 2 points 5 months ago

My favorite feature is how currying is applied literally everywhere. You can take any function that accepts 2 args, pass in a single arg and return a new function that accepts one arg and produces the result. In Haskell, this is handled automatically. Once you wrap your head around using partially applied and fully saturated functions you can really start to see the power behind languages like Haskell

load more comments (11 replies)
load more comments (14 replies)