2

The question comparing the address of string with NULL is asking whether or not the "address of an object can be NULL" which IMO is on par with "can 2 + 2 ever equal 5?" (there is no operator overloading in the question.) This is easily answered by consulting a book or reference.

The OP refuses to post an MCVE because the real code is private, so we're left with pseudo-code of their interpretation of possibly more complex code where there may be a more interesting explanation. Which is leading to a lot of speculation about it. OP's comment pretty much summarizes what I'm about to say:

Yep .. it was so strange to me that I couldn't understand what hell is the condition trying to check!

The question boils down to "look at this silly code my co-worker wrote! amirite guys?"

I feel that it's unlikely to be useful to anybody because the speculative justifications given:

  • it's an artifact of porting old code

  • it relies on the behavior of a broken compiler

  • it relies on undefined behavior

has no verification beyond "because it might be so" or "incompetence". These are value judgments, not aesops that can help future programmers.

Contrast with questions that ask about obscure language features or an antiquated, non-standard but popularly-used function. Comparing the address of an automatic storage variable with NULL is not an idiom I've heard of.

However, none of the close reasons seem to be appropriate. The closest I can find is:

Questions about a problem that can no longer be reproduced or that was caused by a simple typographical error. While similar questions may be on-topic here, these are often resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting.

Should I flag to close or does the question have redeeming value?

2
  • 1
    "Questions without a clear problem statement are not useful" is available as an off-topic vote reason. It just got one such vote. Jun 10, 2016 at 12:35
  • 1
    You need to get out of the perfectionist complex. You want everything to be neat, arranged, closed or open as per your wish, but the real world scenarios work differently. Do not concern yourself with "what can or cannot be done", but rather focus on "what is" and how to improve upon it.
    – manav m-n
    Jun 10, 2016 at 18:15

1 Answer 1

6

Ironic considering that your question is 99% rant.

If you feel the question is off-topic, vote to close.

Otherwise, if you feel like there's no point, move on.

Is the question off-topic? No. It has a clear problem statement ("can this code work?"), a minimal, complete and verifiable example (&foo == NULL) and it's answerable ("no").

Is your question off-topic? Yes.

What types of questions should I avoid asking?

To prevent your question from being flagged and possibly removed, avoid asking subjective questions where ...

  • there is no actual problem to be solved: “I’m curious if other people feel like I do.”

  • your question is just a rant in disguise: “______ sucks, am I right?”

1

You must log in to answer this question.

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