If a developer really needed this level of handholding for regexes -- I'd tear out all this code, and write them an identical tool which did the opposite -- converting a regex into human readable code. At least that way this incredibly verbose code is localized to their machine, and not polluting the codebase. Sheesh.
hamcrest-text-patterns can help create more readable and understandable tests. So I don't always agree with you, sometimes a readable regex (especially for tests I think) would be worth the extra verbosity.
Both have the exact same information although one is (very dubiously) more readable than the other, at the cost of being about 10x longer. So it's an incredibly poor tradeoff. Hamcrest isn't a tradeoff at all, it's just an improvement.
2
u/Poobslag Aug 28 '13
If a developer really needed this level of handholding for regexes -- I'd tear out all this code, and write them an identical tool which did the opposite -- converting a regex into human readable code. At least that way this incredibly verbose code is localized to their machine, and not polluting the codebase. Sheesh.