News for hackers. Stuff that matters.
Re:Coconut: Simple, elegant, Pythonic functional programming by Zababa on Thursday November 04, 2021 @09:14AM (#29106749)
> Things quickly get out of hand once you have a more complex problem like recognising a valid URL

I'm not sure it's so complex. What's the equivalent code for recognising an URL? Regex are implemented in many languages, so this regex is, in a way, a portable library/function in most programming languages. And since it's shared, it can easily be checked way more than any single library would be.

Re:Coconut: Simple, elegant, Pythonic functional programming by jimsimmons on Thursday November 04, 2021 @10:41AM (#29107798)
Portability is an orthogonal concern. I agree with you that it's the reason regexes are the way they are but we could have also had better cross platform APIs.
Re:Coconut: Simple, elegant, Pythonic functional programming by Zababa on Thursday November 04, 2021 @11:47AM (#29108636)
Regexes are still better than cross platform APIs, they're an abstract concept. Just like you can implement a tree or a graph in any language and transfer your "tree skills" or your "graph skills", you can do so with regexes.