Post B1P1JRiuLhingHRTcW by steeznson@glasgow.social
 (DIR) More posts by steeznson@glasgow.social
 (DIR) Post #B1NjTUvhI47oBi6k4W by raiderrobert@mastodon.social
       2025-12-18T14:00:33Z
       
       0 likes, 0 repeats
       
       Functional programming won't solve all your problems. If you insist on it, you'll just move them around on your plate. Was recently re-reading the Unicorn Project and the main character had some wildly optimistic views about functional programming that I've heard echoed by others in real life.Sometimes you want to model your problem space with shared state. If you're like, "nah, I only do functional stuff", you'll find yourself doing a lot of extra work ime just to do the same thing.1/
       
 (DIR) Post #B1NjTW1PEKHlZhmobo by raiderrobert@mastodon.social
       2025-12-18T14:00:34Z
       
       0 likes, 0 repeats
       
       The flipside is also true. Sometimes modeling your problem in an OO style makes your life really hard.So don't get me wrong. I tend to write my code in a functional-leaning style. I actually like it a lot!I'm just not a purist this way. They have trade offs.2/
       
 (DIR) Post #B1NjTWnGMOZBy8B2Ce by steeznson@glasgow.social
       2025-12-18T17:08:00Z
       
       0 likes, 0 repeats
       
       @raiderrobert this mixed paradigm approach is part of why python has been so successful. In some ways it is more deeply rooted in OO than Java by having the primitives be full classes with methods but then treating everything as a first order object allows you to deploy functional techniques like closures and currying. It doesn't get everything right but often feels like the best of both worlds.
       
 (DIR) Post #B1NjTXT5qs1k3rkRP6 by vikingkong@misskey.vikingkong.xyz
       2025-12-18T18:51:34.283Z
       
       0 likes, 0 repeats
       
       @steeznson@glasgow.social @raiderrobert@mastodon.social List comprehensions and other stuff like this don't make Python any "functional".
       
 (DIR) Post #B1P1JRiuLhingHRTcW by steeznson@glasgow.social
       2025-12-18T22:42:21Z
       
       0 likes, 0 repeats
       
       @vikingkong @raiderrobert not list comps. python is functional because you can do things like this where functions can pass each other around:def multiply(x): def closure(y):  return x * y return closureclosure_result = multiply(3)(4)
       
 (DIR) Post #B1P1JTGyaWZEUEOCMS by steeznson@glasgow.social
       2025-12-18T22:43:27Z
       
       0 likes, 0 repeats
       
       @vikingkong @raiderrobert urgh auto formatted, going to use _ to represent whitespacedef multiply(x):_def closure(y):__return x * y_return closureclosure_result = multiply(3)(4)
       
 (DIR) Post #B1P1JU0hqV9Am3midk by vikingkong@misskey.vikingkong.xyz
       2025-12-19T09:47:35.575Z
       
       0 likes, 0 repeats
       
       @steeznson@glasgow.social @raiderrobert@mastodon.social Holy shit, one can use closures in Python. Look, Mom, it's currying, I'm a Haskell programmer now 🤭