3 ms·
I find it strange how obsessed people are with structural pattern matching while simultaneously putting little mind towards function head pattern matching e.g.
by jb3689 5y ago
I find it strange how obsessed people are with structural pattern matching while simultaneously putting little mind towards function head pattern matching e.g. Erlang/Elixir. These break up recursive functions so nicely. Maybe it is the lack of TCO in said languages?
- valzam 5y agoNot just recursion but also error handling. Gets all the if x = nil checks out of the way and the actual function only has Business Logic. Same for functions that need to operate differently based on input, no pollution of the body with if branches
- de_keyboard 5y agoI love this style of programming but it does not work well in Python, the language just isn't built for it. TCO is one limitation. Another is that performant Python code sends large chunks of work to native libraries and recursion inside of Python functions is pretty much the opposite of that.