Considering trying a bit of #haskell today to take my mind off of this C project that’s doing my head in. Any recommended reading for a total beginner?

@Ghastlyghost no. Python, or Go.

Starting from C, Go is actually easier. Python is cleaner.

Haskell is like programmers from the early 2000s looked at Perl 5 and said "to many alphabetic characters. Needs more weird, inscrutable symbols".

@PaulWay @Ghastlyghost I just wanna dip my toes into the realm of functional programming for a twist on things, not looking for an easier experience so to speak.

@Ghastlyghost Look, fair enough.

But functional programming is very easy in Python. You don't need Haskell for that. Think less in terms of "I'll write a function for that" and more in terms of "I'll string a series of iterators and filters together for that".

My caution with this comes from some code I reviewed yesterday.

This function took a list, created a list comprehension to find a specific value inside each of the dictionaries in that list, created another list comprehension to find the values that were in another dictionary (a set of legal values), sorted it according to the legal values dictionary values, reversed that, and then found the first element.

I replaced that with a `for` loop that iterated through the original dictionary, got the values, `continue`d if they weren't in the legal values dict, and then kept a track of the maximum value.

Their code was O(n log n), mine was O(n). Mine uses less memory too.

So, yes, learn the functional programming twist on things. But that's a practice that you can't easily take back to C. I'd suggest thinking about what you actually want to learn, rather than just free-walking wherever functional programming takes you.

@PaulWay @Ghastlyghost That analogy looks surprisingly similar to the code I’ve been trying to write in C actually. I’m a beginner with programming in general at best, but I’m also ADHD as fuck so I have a compulsion to keep things fresh even if that means dropping things for a day or two hence the “changing of gears” I guess. Sometimes it’s for novelties’ sake! Also what I want overall is a foundation in C before I start accruing more languages in general. Looking forward to Rust eventually.