Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
StilesCrisis
· 6mo ago · 0 comments
Why? Unless it's an extraordinarily hot code path, it doesn't matter. A regex once compiled will be quite efficient.
Comments
[–]
gspetr
6mo ago
It's simple, unless you're given a specific broader context (like we have an enterprise customer data pruning system that needs to handle a broad range of corner cases) then you must not resort to overengineering
this
early in an interview.
[–]
suttontom
6mo ago
This is a good example of being bad at writing code.
[–]
Chris2048
6mo ago
And an extra import. also, it sounds like they where looking specifically for knowledge of built-in operators.
[–]
JCTheDenthog
6mo ago
You have a problem, so you try to solve it with a regex. You now have two problems.