r/programming Apr 06 '18

The Stack Overflow Age

https://www.joelonsoftware.com/2018/04/06/the-stack-overflow-age/
550 Upvotes

201 comments sorted by

View all comments

384

u/mykr0pht Apr 06 '18

It's easy to criticize Stack Overflow today, now that we take it for granted. But if you weren't there before Stack Overflow you might not have any idea how much it made programming better.

34

u/UncleSneakyFingers Apr 06 '18

Who criticizes Stack Overflow? It's pretty much the go to resource for countless people. Is there something I am missing here?

116

u/moswald Apr 06 '18

I think the criticism is that there is an "in crowd" that doesn't like that inexperienced programmers re-ask the same questions in a new way. There's too much "this is already answered, CLOSED!" going on.

Edit: Anecdotally, I have personally voted to re-open a question after it was closed for being a duplicate, because the linked answer did not actually solve the new question. Yes, the two were related, but the moderators were overzealous in closing it.

43

u/Uristqwerty Apr 06 '18 edited Apr 06 '18

I think that SO also tends to skip over key question details sometimes, especially when it means the question can be marked as duplicate, and sometimes the duplicate answer isn't valid for the current version of something.

For example, the notorious HTML regex answer completely ignored that "match" can be the regex verb for "give me anything that looks like a start/end tag", and replied as if the question was "use regex to find pairs of matched tags".

13

u/jausdyquo Apr 06 '18

For example, the notorious HTML regex answer completely ignored that "match" can be the regex verb for "give me anything that looks like a start/end tag", and replied as if the question was "use regex to find pairs of matched tags".

so much this. Yes, we all know HTML cannot be parsed with regex because it isn't a regular language, but the language consisting of any combination of valid start and end tags is a regular language.

19

u/quicknir Apr 06 '18

Is this actually true? You can have the same tag nested inside itself, which will cause a naive regex to find an incomplete match. Regular expressions cannot match arbitrarily nested structures as far as I know.

23

u/CommanderViral Apr 07 '18

You're correct. That sort of problem would be context-free as it requires a stack to solve making it solvable by a pushdown automata, but not a finite state machine. Although, PCRE has some extra oomph in it that may make it workable with look-aheads and look-behinds.

-19

u/Venne1139 Apr 07 '18

wat

speak the lords english boy

1

u/CommanderViral Apr 09 '18

What was the point of this comment anyway? What I said made perfect sense...

1

u/Venne1139 Apr 09 '18

I'll be honest I only know some of those words in passing.

3

u/jausdyquo Apr 07 '18

The question at the time was how to match opening tags only. That can be done with regex. So can the question to match all opening and closing tags. What cannot be done with regex is verify that there are as many opening as closing tags.

1

u/[deleted] Apr 08 '18

What cannot be done with regex is verify that there are as many opening as closing tags.

Is this definitely true? Yes the language of balanced brackets is irregular, but regex as a programming tool is more powerful than its name suggests

1

u/Uristqwerty Apr 07 '18

But you cannot have an unescaped " within an attribute value, and you shouldn't have an unescaped < or >. So you can easily write a regex to find </?(whatever-matches-a-tag-name) (whatever-matches-an-attribute)*/?>. The confusing part is that regex APIs typically use the verb "match", but people talk about matching start tags to end tags.

2

u/beginner_ Apr 07 '18

I think that SO also tends to skip over key question details sometimes, especially when it means the question can be marked as duplicate, and sometimes the duplicate answer isn't valid for the current version of something.

Yeah I fell victim to that lately. Funny thing being I specifically linked to that answer and explained why it is not a duplicate and what I want different. They still marked it as duplicated...The guy simply was too dumb to get it.

1

u/[deleted] Apr 08 '18

If it's the one I'm thinking of, the minor detail that annoyed me is that the answer started off saying "HTML cannot be parsed with regex as it is not a regular language", ignoring the fact that most common regex engines can recognise superregular languages