3 ms·
My team has just spent 20 minutes trying to work out if this library is satire. I love functional programming (use Elixir at work a fair amount), but almost ev
by rkangel 3y ago
My team has just spent 20 minutes trying to work out if this library is satire.
I love functional programming (use Elixir at work a fair amount), but almost every one of these examples is harder to read than than the equivalent "classic" Python (https://returns.readthedocs.io/en/latest/ https://returns.readthedocs.io/en/latest/).
Plus, if you're going to write Python then deviating majorly from the normal approaches is going to require maintainers to learn a whole new way of doing things. Given the tools that Python provides, I don't think that's worth it for the benefit. Perhaps for some specific applications?
- steinuil 3y agoThere's libraries like these for many languages and no, they are not satire. I see it as a misguided attempt to bring some patterns from languages that are "better" (by some metrics) into a language that doesn't have good support for them. By my experience, younger programmers are more likely to want to do this. I fell into this trap myself with a similar library for TypeScript, and discovered the hard way that code written this way was much less readable and debuggable. Less readable because you're essentially reimplementing variable assignment and control flow with lambdas and bespoke syntax that looks out of place. Less debuggable because the stack traces from these things blow up exponentially, and make it very hard to understand where an error came from. So yeah, it's not satire, just misguided. If you have to use Python you're much better off sticking to the usual patterns and apply more static analysis on top rather than trying to reinvent the language this way.