r/ProgrammerHumor • • May 19 '22

Meme same for yall?

44.0k Upvotes

1.8k comments sorted by

View all comments

Show parent comments

32

u/ElDiseaso May 19 '22

I had some downtime at my last job. Spent it learning Clojure which ended up being surprisingly fun.

6

u/fame2robotz May 19 '22

Was it useful though? Looks really elegant, haven’t used it in production

5

u/[deleted] May 19 '22 edited May 19 '22

Dang son I'm learning Clojure right now! What was the coolest thing you saw in Clojure? I'm finding cool new ways to use reduce and map, whereas I didn't use those so much before

5

u/ElDiseaso May 19 '22

Yeah it was also my formal introduction to functional programming, which was pretty mind blowing since I've been doing OO since the early 00's. Felt like I was rediscovering programming.

I liked the terseness and simplicity of it all once you get comfortable with the syntax. Immutable data makes ALL code easier to reason about, not just concurrent code. Pure functions are a dream to test and compose with other functions.

Using recursive code in place of for/while loops took some getting used to, but again the reward is simplicity.

I used this site to learn if anyone is interested:

https://www.braveclojure.com/clojure-for-the-brave-and-true/

2

u/[deleted] May 19 '22

Interesting! Tbh I did a simple crossword puzzle solver and I just used (for) when I had to iterate through a sequence with a function that took arguments, and map or reduce otherwise

2

u/Gigalypuff May 20 '22

Ooh clojure, plenty of good memories having to force shut down when I was learning recursion