Yeah, I understand and agree explicit code can be good sometimes but my pseudo-code was arbitrarily picked to show how the same exact task could be made more difficult to follow by being too verbose. There is no ambiguity in the AM's answer above and your version was harder to read and therefore more likely to disguise bugs and poor optimization/operator choices; which it has and it does compared to the original answer. Your solution drops anything other than ASCII alphanumerics and, bizarrely, commas; and regular expressions are a confusing and sub-optimal choice for single character looping and comparisons.
Things like a next as the last instruction in a loop is explicit to the point of... well, it's so obvious, it becomes distracting noise. Overly verbose or simplistic becomes confusing (What? Why would anyone do that? I must be missing something, better read this again five times) or talking down. Talking down to other devs is a good way to make them slowly despise you.
Put another way: elegant code lifts me up, makes algorithms obvious, condenses ideas into easily assimilated blocks, saves me time, and helps make me become a better hacker; simplistic code doesn't. I don't like golf in the code base more than anyone else but I sure as monkeys prefer a Schwartzian transform over 4 back to back for loops.
(Update: I missed the rest of the thread earlier that already covered some of this. Sorry about that. I also think this reads harsher than I meant. I do agree that code can be made explicit to everyone's benefit; just wanted to say that explicitness for its own sake is self-defeating.)
In reply to Re^4: Regex question
by Your Mother
in thread Regex question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |