5 ms·
The problem with this is that one of the best way to learn real lessons that stick in this line of work is to do it the hard way first. Being told you’re doing
by jordanpg 7y ago
The problem with this is that one of the best way to learn real lessons that stick in this line of work is to do it the hard way first. Being told you’re doing it the hard way and never learning firsthand why is no kind of lesson.
These XY answers should contain a mention of Y, if relevant, skip the scolding, and answer the question.
- ceejayoz 7y agoSometimes, "here's why you're about to accidentally put your head into a wood chipper" is enough to learn a lesson from.
- ratww 7y agoIf it were a wood chipping forum/chatroom, sure, but it's a programming Q&A... people might need the answer in the future. If you have the answer but would rather the person not do it, just put a disclaimer on top of your answer. If the question/answer combo is way too specific that there's no chance someone is going to to benefit from it the future, maybe it should die, like other posters said.
- ceejayoz 7y agoThere are cases where there isn't an answer. A common one I come across is people trying to track who's online/offline with window.onbeforeunload. The answer is always "that's not reliable, you can't really use it for this". A good answer mentions the alternatives - storing the user's last activity and considering them logged out after X minutes, using websockets for a presence channel, etc. I see no reason to avoid the "you can accomplish your underlying goal in a better way" answers.
- ratww 7y ago> The answer is always "that's not reliable, you can't really use it for this". Only if the question is "Is window.onbeforeunload reliable to track online/offline users?" In every other case, that should be a disclaimer on top of an answer to the actual question. Maybe future users don't need 100% reliability for some reason. Maybe they're just trying to find out if something like onbeforeunload even exists. Sure, showing better ways is fine. As long as there is an actual answer somewhere (preferably with the disclaimer), instead of cute but condescending non-answers like [1]. [1] https://stackoverflow.com/a/1732454 https://stackoverflow.com/a/1732454
- ceejayoz 7y ago> Only if the question is "Is window.onbeforeunload reliable to track online/offline users?" We're gonna have to disagree on this. That's like me asking "how do I get to this restaurant", and you give me directions to the place that burned down a year ago without mentioning that. Useless, and infuriating when I drive a half hour to discover it.
- ratww 7y agoI know it's impolite to say that here, but if you actually read the rest of my reply, you'd see that in my opinion the best answer for a Q&A site would be "The restaurant burned a year ago, but it was at 450, Blahblah street". Maybe I didn't make it clear enough before, but I am saying it now. Consider that the asker might just using the restaurant as a reference to some other place. Or someone "hearing" the answer in the future wanted to know the address to visit the ruins. The information might still be useful. Consider that you might not always know better. If this were a chatroom or forum, fine, answer informally. But we're talking in the context of a Q&A webiste.
- ceejayoz 7y agoThe most likely answer the OP in that scenario needs is "it burned down". If they want to visit the ruins, they can easily say so in the comments and likely get an updated answer (or they can mention it in the original question; perhaps they'll think to do it the next time around when they've got an unusual requirement).
- mark-r 7y agoSo you'd be in favor of the question "What's the best regular expression for parsing HTML?"
- gqcwwjtg 7y agoSure, there's a pretty reasonable answer about regex flavors with recursive extensions and how that makes them non-regular, which transitions nicely into a discussion of why you should just use a standard parser.
- ratww 7y agoWhy not? Like it or not, regexes are able to parse a limited subset of HTML. By explaining why they only can parse this small subset is a great teaching opportunity on Chomsky Hierarchies. And the people searching for it might learn that XML parsers exist. By actually giving an answer to the question (after saying the above of course) you might be helping thousands of people parse very simple HTML when they're in a hurry. By saying [1] you're just adding low-effort content on the internet that doesn't teach anyone anything, but make you look cool to your peers. [1] https://stackoverflow.com/a/1732454 https://stackoverflow.com/a/1732454
- mark-r 7y agoAnyone incapable of writing their own regular expression for this is unlikely to know when their problem is too complicated to be solved by it. You're not actually doing them a favor by answering the question.
- ratww 7y agoThat's bullshit. By explaining to them Chomsky Hierarchies they can understand limitations of regexes and learn about parsers and. By showing them the regex able to parse a limited HTML subset they might be able to try it out and see such limitations by themselves on their own screen. Additionally they might be able to learn some new regex tricks. Maybe you learned things in a different way, but lots of people enjoy learning stuff by doing and by seeing demonstrations.