Hacker News new | ask | show | jobs
by rkagerer 1299 days ago
As an aside, this is why I hate regex. The expressions are too convoluted for a human to readily parse and understand. Unless there's a good reason, I prefer to stick to imperative parsing code (and have developed personal tooling to help with that).

Part of elegant development is abstracting at the right places to make your code communicate what it's doing to the next person working on it (which could include future you).

1 comments

Too convoluted for a human to readily parse and understand? The same could be said for pretty much any code. As with anything else, the more practice you have reading and writing regexes, the easier they become.

If you ask me, the real boogeyman is lack of programmers' comments that explain what the regex is doing. In other words, the fault lies not with the tools, but PEBKAC.