11
\$\begingroup\$

The question about NOT macro: is this bad practice has been closed for not providing concrete context. But what else could OP have written to make it on-topic? OP also explained why he likes this solution.

I find he did everything right. The macro is a one-liner with a usage example.

\$\endgroup\$
1

2 Answers 2

7
\$\begingroup\$

I agree, there have always been discussions about 1-liner questions, and I feel the specific question here has been closed because the closers saw the "use case" as being example code, but it's just a test-case, not the code under review itself.

I've been discussing the question in the 2nd monitor, and I believe it should be reopened when it clearly separates the code under review from the example use-cases of the code.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ And now I have reopened it. \$\endgroup\$
    – rolfl
    Apr 13, 2018 at 18:18
5
\$\begingroup\$

I'm one of those who close-voted the initial version of the question. My personal reason was that the macro was embedded in example code around a hypothetical scenario and example. What's under review? The example? The macro? It might be the macro definition or the macro usage, or both.

I initially asked in the 2nd monitor whether it's on-topic and then got pulled into closing by the "close(2)" vortex, although I already had my answer ready. Additionally, I accidentally misread OPs additional question as "what are the best practices", which is a section in dont-ask. Immediately after my vote I thought about alternative formulations that would make it on-topic and edited it after I got the author's OK.

So to answer your original question: you cannot do much, to be honest, except make it clear that your one-liner is under review and add several examples.

\$\endgroup\$

You must log in to answer this question.

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