6

I sometimes ask questions for which the answer is "this is not possible". One common source of these (and I suspect this happens to other question askers as well) is the relative lack of power of certain tools, such as CSS or regex. CSS can accomplish a lot of things, but it can't accomplish everything. So, questions asking "How can I accomplish X using CSS" sometimes have a "not possible" answer.

However, things that aren't possible in CSS are usually possible with JavaScript. This tends to elicit answers that "this isn't possible in CSS, but it can be accomplished in JavaScript. See here:...". e.g. (Note that in this question, @isherwood seems to have made a post hoc edit to the question to attempt to make the question accommodate his answer of "not possible... but". IMHO making the question more vague doesn't help clarify though - it hides the aspect of "trying to accomplish this in CSS" which obviates the useful "not possible" answer.)

I now have a question about CSS with a JavaScript answer. It seems that this answer actually answers two questions:

  1. "Q: How to do this in CSS, A: Not possible" and
  2. "Q: How to do this in JS, A: here's how...".

However, I can't edit my post so that it actually asks both of those questions; posts asking multiple questions get closed as Needs More Focus.

Does anyone have recommendations on general strategies to edit such questions post hoc or to a priori phrase questions that I suspect might be "not possible...but" so that they can accommodate both the original answer ("not possible", which is useful info to anyone looking to accomplish this) and also the new answer (the workaround) to the question I didn't ask?

22
  • 3
    ".. seems to have made a post-hoc edit to the question to attempt to make the question accommodate his answer .." ... I honestly don't see how they did that. Do you mean by removing the "css" in the title? Tags don't belong into the title and they didn't add a "javascript" tag, so it is still only tagged with "css".
    – Tom
    Apr 26, 2022 at 17:28
  • 3
    Just because someone provides additional information in their answer does not mean the question is magically asking multiple separate things. If the question is "how to do this in CSS" that's just one question. Someone can answer "you can't", and someone else can answer "you can't. Here is how you would do it in JS though" and both would be valid answers. If someone only said "Here is how you would do it in JS", that's a problematic answer, but it still doesn't mean the question has a problem.
    – TylerH
    Apr 26, 2022 at 17:49
  • @TylerH "has a problem" At the same time, a visitor to the site who reads this question would not expect to find an answer detailing how to accomplish the workaround. My goal here is to improve the documentation to be better, not necessarily to simply meet the bare guidelines for site acceptability.
    – Him
    Apr 26, 2022 at 17:59
  • 1
    An edit isn’t necessary: it’s always OK for an answer to include alternatives and work arounds. This is true even when something is possible in the given language/tech. For example, one could ask how to do something in JavaScript and an answer saying “This is possible using just CSS, here’s the code…” would be OK.
    – BSMP
    Apr 26, 2022 at 18:03
  • @BSMP "would be OK" but now there is "hidden" info in an answer. When I read a question about how to do something in CSS, I wouldn't necessarily expect to find a js answer. Again, the goal here isn't to make a black-and-white distinction between what's okay or not okay, but to improve my question so that people searching for answers have the maximum probability of finding them. IMHO, my question should lead people to "expect" the answers that they find there.
    – Him
    Apr 26, 2022 at 18:05
  • @Tom it seems that questions asking for solutions in css frequently reference css in the question title? Is this inappropriate?
    – Him
    Apr 26, 2022 at 18:08
  • 5
    "a visitor to the site who reads this question would not expect to find ...the workaround" - why? My guess that most visitors are looking for any solution - those who already investigated the problem likely know "no" answer and need a workaround, and those who did not research are likely don't care about exact language match either... Apr 26, 2022 at 18:37
  • 1
    @Him When you build an actual sentence where the tag is mentioned, then it can be fine, but it is still redundant. In this case, however, it was just a prefix to the actual question text.
    – Tom
    Apr 26, 2022 at 19:47
  • @Him When I ask a question here, I have no control over what someone decides to include in an answer to that question. I can leave comments or vote on it, but if someone wants to provide additional information beyond what I asked, that information becomes an aspect of the answer, not an aspect of the question, and attempting to penalize the question for it somehow is incorrect. Doing so would discourage many of the more useful/educational answers on Stack Overflow.
    – TylerH
    Apr 26, 2022 at 20:36
  • @Him Stack Overflow is not a documentation resource; it is a Q&A repository. In fact, the organization tried to leverage its position and skill set to create "SO Documentation" specifically to serve that role, but that attempt failed and was shuttered shortly after launch. I recommend not trying to make questions and answers fit neatly into a 'documentation' format, because that's not what the site is designed to provide.
    – TylerH
    Apr 26, 2022 at 20:38
  • @TylerH what do you mean by "penalize"? I don't view editing my questions with the intent to improve site content as a "penalty". When I ask a question, it is because I don't know what the answer is. Sometimes, in retrospect and in the knowledge of what the answers are, it turns out that my question could have been better. Making after-the-fact changes to my question to improve the overall content seems like correct action to me.
    – Him
    Apr 26, 2022 at 20:39
  • @Him You suggested earlier that a question should be closed as "Needs Focus" if someone posts an answer to it that shows how to do something other than what the question asked. That seems like penalizing (read: "applying a penalty to") the question to me.
    – TylerH
    Apr 26, 2022 at 20:40
  • 1
    You mentioned regex. I always find mentioning Tony the Pony helps. Apr 27, 2022 at 2:35
  • 1
    Does this answer your question? A car with square wheels Apr 27, 2022 at 8:58
  • 1
    Seems pretty simple; Ask the question. Say what you've said here: "I'd prefer a pure CSS solution. If this is not possible, a solution using JavaScript (preferably not using any libraries) is acceptable." I added the bit about libraries, to fend off the inevitable 1001 "there's a jQuery plugin that does that" answers. Nothing exciting, just a few words about requirements. Apr 27, 2022 at 22:03

2 Answers 2

6

Are you aware of the XY problem?

If you know that there are other technologies which might solve the problem, it would be useful to either say you'd accept answers using them or give a brief reason why you can't use them (but don't be upset if people don't accept the reason).

Also, remember that the Stack Exchange sites are intended to be a repository of knowledge for everyone, so someone else with the same problem may be happy to find an answer which uses, say, jQuery, even if that particular answer was of no use to you. (The "Wisdom of the Ancients" XKCD cartoon is so nearly applicable here.)

6
  • 3
    I'm not sure that this is an XY problem. I really do want to accomplish this with CSS. That is my question. The fact that it is "not possible" doesn't mean that I was asking a question about something else. In all seriousness, if the question were "how to do this in Javascript?" I wouldn't have even asked the question, because I could have done it myself.
    – Him
    Apr 26, 2022 at 17:15
  • 11
    The XY problem is not about using a different language than what is ideal. It's about trying to force a square peg in a round hole because you found a square peg first and stopped looking for the round peg.
    – TylerH
    Apr 26, 2022 at 17:53
  • 1
    Except the square peg may have benefits over the round peg, such as being cheaper or whatever. So if there is a way to fit it, it would be preferrable. Only if it's not possible, one would consider using the round peg as solution then. (CSS is usually preferrable over JS because of its higher performance and declarative nature.)
    – CherryDT
    Apr 27, 2022 at 9:25
  • @TylerH which fits this scenario to a T. "I want smooth scrolling for this section with JS, how to do that?" "You don't need JS, you just need CSS!". Remove "with JS" and the answer becomes "This is how you do it with CSS".
    – Braiam
    Apr 27, 2022 at 10:14
  • 1
    @CherryDT Yes, if you change the scenario, then the label may not apply anymore.
    – TylerH
    Apr 27, 2022 at 14:19
  • 1
    Let's also not rush to posting an answer. In 2022, it is VERY, VERY hard (nearly impossible) to ask a good, unique, narrow, on-topic question. If the question has been Resolved Elsewhere, please flag/vote to close instead of adding more redundant noise to Stack Overflow. It is entirely likely that Stack Overflow already has 3 or 5 or more pre-existing pages that provide the necessary solution. ... help people find the right answer by getting all of those answers in one place. Apr 27, 2022 at 22:17
1

As with many things in life: it is a judgement call.

When deciding whether to widen the scope of a question based on answers, always ask yourself if value will be lost were the answer to be removed? Some answers, even if they broaden the scope of the question are stellar: detailed, properly formatted, well-written, etc. They provide value, so it makes sense to tweak the question a little to make an allowance for it (that said, if the question explicitly states that solutions in other technologies are unacceptable, I would avoid making such an edit as we generally strive to preserve authorial intent).

If answer does not provide great value, try to find a common duplicate target that explains how to solve the problem in the technology of the answer, and if so, then the answer is actually harming the repository of knowledge such as we are because every user landing on it is one user that seen the canonical less. I do not propose outright deletion of such answers, but they certainly do not merit widening the scope of the question.


An off-note about your example post: it seems that you misunderstood the nature of the edit — the user was simply removing tag duplication from title as the question is already tagged (the original title started with "css how").

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .