5 ms·
Awful? It is inscrutable black magic and it is wonderful once you get it. I haven't touched perl in years but I still find myself writing regex often!
by pdntspa 3y ago
Awful? It is inscrutable black magic and it is wonderful once you get it.
I haven't touched perl in years but I still find myself writing regex often!
- masklinn 3y agoAlso various langages allow formatting & commenting regexes and that’s quite useful. Named groups as well.
- Dylan16807 3y agoYes, awful. It takes a crack in the wall and drives a bus through it, at a significant penalty to readability. The compatibility advantage doesn't matter when you're evaluating syntax in a vacuum.
- pdntspa 3y agoNot everything has to be super easy-to-use.
- Dylan16807 3y agoNobody is suggesting super easy to use. But sometimes interfaces could be easier with no loss of ability, because they grew over time and nobody ever fixed them.
- pdntspa 3y agoIt is terse for a reason. You're ordering a parser around in 10 characters. Which makes them fit everywhere! A longer more readable version starts taking up multiple lines and looking like shitty react code. Or you're just using your language's string primitives. But there is a reason that nobody does that any more -- who wants to read 50 lines of string parsing code when a couple dozen characters of regex will do the same thing? Let us wizards have our magic!
- Dylan16807 3y agoThe particular syntax being used an example is more verbose than it needs to be, so I don't know why you're making this argument.