Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
atheist998568dI understand that because I wrote a library to build regexes. But I wrote a library to build regexes because regexes.
-
A big benefit of code reviews are that the reviewers learn from it. I hope he does.
-
netikras3485368dI used to be like that too.
When you finally learn to juggle the technology it's hell of a fun to do so with every nail you see -
Lensflare1748068dLooks like that guy wanted to show off his regex skills.
And typically those kinds of people don’t care about readability. The more complex and unreadable the regex is, the better, because it looks so cool! And that’s why we are 1337 haxx0rs, right? -
donkulator307868dTo be fair, I can see how someone might encounter regex and come away with the mistaken impression that you're supposed to make them as ugly and confusing as possible.
At least, I hope that's a mistaken impression.
It is, right? -
Ranchonyx1051968dReminds me of people "simplifying" a ton of if-else statements into one ternary... Ew
-
"otherwise we could just specify everything explicitly."
BRO WAS SO CLOSE TO GETTING IT -
WillemD2263dIf you just have 4 cases, I wonder if 4 simple == would have been better.
10400002 || 10400006 || 10400020 || 10400048
If you match specific numbers, it's nice if you can do a search in the project and find the specific number. -
Yeah... I mean if you're really into regexs, sure... But that's certified dumb to do if others are not going to be able to read it.
He just wants to feel better about himself because he "knows" regex.
Related Rants
New developers(5-6 years experience) these days are so pathetic. They dont have any sense of code review. All they want is to put their opinion out without giving any thought.
I had a PR for review today which contains mock specification to match a regular expression and return the corresponding response
The regular expression I put was
104000(02|06|20|48)
Now, this guy comes and puts a comment that we could "simplify" as 104000\d{2}
I replied, the ending digits are not contiguous. The specific pair of digits have to match for these mocks.
Then this guy replied, then we could simplify as 104(0{4}(2|6)l0{3}(20|48)).
I said, I cannot understand how that is simplification. Why do we need such a complex regex to match something very straight forward.
And the guy replied, we should be writing proper regexes, otherwise we could just specify everything explicitly.
I was like WTF man. You try deciphering this next week without taking at least a minute to know which values are matched.
Anyhow, another senior person approved my PR, and I merged it.
rant
newbies
pullrequest
wtf
review
regex