Everything is unreadable until you learn how to read it.
Why is that?
For example 'a*b' is any number of 'a's followed by 'b'.
How else would you concisely state that?
Presumably people who hate array languages think all 3 character regexes should instead be big nested loops, so they are "readable".
When writing a program, I prefer to use a PEG, giving the less compact notation `'a'* 'b'` but also letting me say `'a'* b` and define b as its own rule, including recursion for the useful cases. It helps that it's more powerful, being little more than a formalization of the post-regular strategies used in Perl-style 'regular' expressions while embracing recursion.
For '/' in vim, grep, wherever? Yeah regex is fine, that's what it was designed for.
"a"* "b"
Much more readable and less error-prone.Could you explain this? I don't quite understand what the problem is. Do you mean something like sed's regex substitute command?
If you use syntax like "a"* "b" then it's really obvious - the stuff in quotes is literal text, everything else is control.
Lots of formats make the same mistake, e.g. YAML.
Anyway I'm not sure the same is true for K. At least for the given example the for loop was not exactly difficult to write.