4 ms·
>and its escaping and context rules stem from a time when all we had was ASCII. My keyboard still only has ~ASCII on it, so having to input anything else is a
by Tiksi 10y ago
>and its escaping and context rules stem from a time when all we had was ASCII.
My keyboard still only has ~ASCII on it, so having to input anything else is a huge barrier to entry.
Regex syntax sucks, I'll be the first to agree with that, but it's more of an annoyance. If I write some regex to match ips(obviously not properly, but quick rough match):
([0-9]\.){1,3}[0-9]{1,3}
My thought process isn't "open paren, open bracket, zero" etc, it's more of "Ok, I have a 4 groups of 1 to 3 numbers separated by dots, which can be written as 3 groups followed by a dot followed by a fourth group" and my hands translate it the rest of the way into text.
Knowing exactly which character to use may have been a hindrance the first few times I ran into regex, but the real difficulty is in knowing what to match and how to match it. Providing that info to your computer once you know it is the easy part, even if the interface is horrible.
It's like driving a car or a bike. You don't think "Ok, time to move my hand to move the steering wheel to the right and that will turn the wheels which will then the car to the right", you just need to turn right and your subconscious takes care of the rest.
Improving the syntax would be like trying to improve how well/safely you drive by changing the steering wheel. Sure, it might help a little bit, but that's not really the difficult part of driving well, just an interface to it.
- raiph 10y agoFwiw, adapted from "Parsing an ipv4 address"[1]: / ( (\d ** 1..3) <?{ 0 < $0 < 255 }> ) ** 4 % '.' /; [1]: https://perl6advent.wordpress.com/2012/12/22/day-22-parsing-an-ipv4-address/ https://perl6advent.wordpress.com/2012/12/22/day-22-parsing-...
- savolai 10y agoOk. Please actually read my posts, make an honest attempt to understand what I am actually saying, and come back. If this comment of yours still seems relevant to in any sense of the word, please do tell me, and I will try to rephrase or answer any questions you may have. Would that be ok? Thanks.
- Tiksi 10y agoOk. I did read your posts, especially the one I replied to, and it does in fact seem relevant. However with that level of snark, I'm just gonna drop out of the conversation here as it's unlikely to be productive. Thanks.
- savolai 10y agoSorry. Perceived snark was completely unintended. What I have thought to have repeated here starting from the actual blog post, is that it is completely natural for you to perceive that the escaping is just a nuisance. You are an expert user who has already overcome the initial pain, so you can't feel it. That initial pain is exactly what I am trying to help users overcome. The pain wasn't a prohibitive barrier for you, but you can't really deduce anything from this fact. This is why your perception about your own experience of using regexes is not very useful to this discussion about whether Regex UCR is useful to its main target group. The title of the post was You Are Not Your Users, remember? You are an expert on the tool - that does not mean you are an expert on every use of the tool, of all of the people on this planet, who would use the tool, if only it wasn't broken for them. It also doesn't mean that only difficulty of the usecases you find relevant, like matching parentheses, are the only valid criteria for these users to evaluate whether regexes are useful for them. You bias, as you mention, seems to make it difficult to perceive this. There's nothing wrong with that, of course - that's what most of reddit was doing too. As more and more people are accustomed to modern user experiences, more and more of even developers will not want to go through stone walls just to get a simple matching task done. They require quality from their tools. Also, as many people will never become experts, the initial pain will just repeat on, and on, and on, and on. Correction: brudgers and Tiksi - As you may have noticed by now, I did not notice I was talking to two different people, and my comments reflect this. Apologies for the confusion.
- brudgers 10y agoFor what it's worth, I am not an expert on regex's. A few times a year I might write a very simple regex for something that would otherwise require a lot of tedious repetition. They're just another thing I find intellectually interesting and my comments are based on my struggles to learn them as a non-developer.