News for hackers. Stuff that matters.
Re:The Fall of Stack Overflow by cowthulhu on Tuesday July 25, 2023 @03:41AM (#36859203)
Hilariously, the accepted (I assume by default, not by the asker) answer is flagrantly breaking, like, half a dozen rules and guidelines… but because it’s cynically and unhelpfully crapping on a newbie, it stays up. Or maybe there’s a good reason for it to stay up, but at a glance it sure is t a good look.
Re:The Fall of Stack Overflow by underdeserver on Tuesday July 25, 2023 @04:29AM (#36859523)
Oh come on, it's not crapping on a newbie. It's a funny comment that serves as a reflection of the days and weeks this guy spent debugging these kinds of systems.

As someone who was a newbie at the time when it was posted, who was looking for a way to parse HTML, I took away that it's just really the wrong way to go about it. I didn't feel crapped on at all.

Re:The Fall of Stack Overflow by stavros on Tuesday July 25, 2023 @04:58AM (#36859749)
The question isn't looking to parse HTML (or XML). Regexes are inappropriate for HTML because they can't adequately match the starting and ending tags, not because of black magic. The OP isn't looking to do that, so regexes look like a perfectly acceptable way to go.
Re:The Fall of Stack Overflow by underdeserver on Tuesday July 25, 2023 @03:36PM (#36868146)
I agree completely.

But the asker is very clearly a newbie. The question does not contain further context. The asker's suggestion is wrong (I think). And we've all worked with junior engineers who try to use the wrong tool.

The answer is a whimsical way of making an appropriate suggestion in this inferred context.

Also, to be fair, I think it's not mathematically impossible to use dark regex magic (with look-behinds and such) to parse HTML, but that's a discussion for another day...

Re:The Fall of Stack Overflow by bazoom42 on Tuesday July 25, 2023 @07:44AM (#36860894)
The question is about tokenizing XHTML, not parsing it into a DOM, which is a critical distinction. Regular expressions are a perfectly valid way to tokenize. This is why the snarky answers does not suggest a better solution - there isnt one!

If you scroll down long enough, you will see answers explaining that. But they arent upvoted as the answers suggesting the questioner is an idiot.

Re:The Fall of Stack Overflow by pasc1878 on Tuesday July 25, 2023 @04:54AM (#36859715)
No accepting an answer can ONLY be done by the person asking the question.
Re:The Fall of Stack Overflow by borland on Tuesday July 25, 2023 @04:56AM (#36859737)
That answer is only there because it's really old, from the early days of S.O. where people were allowed to ask questions that weren't super serious binary yes/no style. It'd get moderated and deleted in a heartbeat today. A forlorn monument to the cool place that S.O. once was
Re:The Fall of Stack Overflow by umanwizard on Tuesday July 25, 2023 @07:46AM (#36860913)
Maybe I’m just a fun-hating asshole but personally I find this kind of thing annoying, not cool. People are just trying to get work done, not see someone’s attempt at cringey “nerd culture” humor.
Re:The Fall of Stack Overflow by the_af on Tuesday July 25, 2023 @08:27AM (#36861250)
You agree with SO: those answers are no longer allowed, and haven't been for years. They are only kept as historical artifacts, and marked as such.
Re:The Fall of Stack Overflow by eitland on Tuesday July 25, 2023 @10:08AM (#36862477)
That is not what most of us complain about I think.

I and I think many other are sad that S.O. removes many serious work related questions (have lost count of how many times I saw the perfect question with the perfect answer, with a note that this isn't what Stack Overflow is made for and these questions only exist for historical reasons).

Re:The Fall of Stack Overflow by Etheryte on Tuesday July 25, 2023 @05:24AM (#36859898)
The answer can only ever be accepted by the asker, not even mods can change that. It's actually not that rare that the accepted answer is not the one with most votes in which case the accepted answer is somewhere further down, not the first one on top.
Re:The Fall of Stack Overflow by cowthulhu on Tuesday July 25, 2023 @03:07PM (#36867739)
Oops, you’re right! I was totally misremembering.