4 ms·
but let's face it, posting this on StackOverflow is like handing a loaded gun to a bunch of children and telling them not to pull the trigger. No, let's
by rkalla 15y ago
but let's face it, posting this on StackOverflow is like
handing a loaded gun to a bunch of children and telling
them not to pull the trigger.
No, let's not face it. How is sharing well thought out, designed solutions to problems ever a bad thing. Sure there are a handful of junior coders that now feel overly confident and will mess this up, but they'll learn.
And then there is an equal pool of good developers that are now even better thanks to the info-share.
I acknowledge I'm being pedantic, but the Let's all nod and pretend we are way smarter than THAT group over there mindset gives me brain-diarrhea... you see it in every community (reddit, slashdot, HN, digg, etc.) and I've never seen it help anybody accomplish anything, anywhere... ever.
</takes off his internet-police hat>
- 3am 15y agoNo, using regexes for this is terrible. I could write you a program that will parse html employing GOTOs, but it's been recognized as a bad programming practice. I'm not going to do your research for you, but this is not opinion, it's the result of people studying large code bases and defect rates within them. Same goes for overly long functions, bad variable naming, poor commenting, and so on.
- yid 15y agoA correctly written regex is not a bad programming practice. The insinuation that most programmers can't write or debug a regex correctly is disingeneous.
- 3am 15y agoFirst, correctly written code can be bad practice. Regexes are a powerful tool, and have appropriate uses. I disagree this is one of those cases, but at -4 on my previous comment, I guess most don't agree. Second, I would bet the majority of programmers are mediocre with regular expresssions at best, and even worse at reading regexes written by other programmers contributing to code maintenance issues. Finally, I may have been "incorrect" but "disingenuous" is an insult. I'll be charitable and assume you're using the word wrong.
- yid 15y agoPerhaps it's a difference of experience, but I really haven't met a professional programmer who doesn't understand regexes but still insists on using them for non-trivial tasks. Thus my usage of "disingenuous", because I have trouble believing that such people exist, and I felt you were trying to make a point insincerely, perhaps out of confirmation bias. I apologize if it came across as an insult -- it wasn't intended as one.
- 3am 15y agoNo harm, no foul. They really do exist, unfortunately.
- irahul 15y agoUsing "regexex" for doing what is terrible? Using regexes for a lexer is quite common, and if you read his code, that's what he is doing, and then feeding the tokens to the parser.