this post was submitted on 02 Oct 2023
786 points (98.5% liked)

Programmer Humor

24736 readers
1570 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 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] PapstJL4U@lemmy.world 28 points 2 years ago (2 children)

Before studying CS, I recognized it as 'the bioware puzzle'. They were probably copying their own scribbles fron back then.

Haskell was the hardest, but it looked the most beautiful.

[–] lugal@sopuli.xyz 28 points 2 years ago (2 children)

Haskell was the hardest, but it looked the most beautiful.

That pretty much sums that language up

[–] TheBananaKing@lemmy.world 8 points 2 years ago (1 children)

In order to write a haskell program, you must first write the corresponding haskell program.

[–] lugal@sopuli.xyz 3 points 2 years ago

And in order to do that, you have to imagine sisyphus happy

[–] DarkenLM@artemis.camp 7 points 2 years ago (1 children)

Strange. I find the language hideous, most likely because it resembles math, or maybe because I'm already used to the C-like syntax.

[–] lugal@sopuli.xyz 13 points 2 years ago (1 children)

Haskell is beautiful because it resembles math

[–] xigoi@lemmy.sdf.org 12 points 2 years ago

It's also beautiful because it doesn't have C-like syntax.

[–] Knusper@feddit.de 9 points 2 years ago
hanoi :: Integer -> a -> a -> a -> [(a, a)]
hanoi 0 _ _ _ = []
hanoi n a b c = hanoi (n-1) a c b ++ [(a, b)] ++ hanoi (n-1) c b a

From here: https://www.rosettacode.org/wiki/Towers_of_Hanoi#Haskell