2

I keep finding myself posting an [mcve] link in comments to questions with either too much or too little code, but askers seem to be having a hard time actually producing a "Minimal, Complete, and Verifiable Example". To improve the situation, I was planning to submit a Q&A, that contains the shortest possible code needed to implement an application for a small number of common application types1.

While I have no problem coming up with the answer, I'm looking for feedback on the question, so as to not let it fall victim to down- or close-votes, due to various reasons.

This is my proposed question, that could easily be closed off as "too broad", or even "primarily opinion-based":

In a comment I was asked to provide a "Minimal, Complete, and Verifiable Example". My application is huge, and iteratively stripping code appears to be unfeasible. I would rather start at zero, and incrementally begin adding code.

I'm looking for help creating the most minimal application for the following use cases:

  • Console based application
  • GUI application
  • Application that installs a hook

Can you show the most minimal code required to implement each of the aforementioned application types?

The code required to implement either of these is tiny; neither code block will show vertical or horizontal scroll bars (in the desktop version of Stack Overflow), and I believe the question is sufficiently scoped.

Having been burnt in the past with a similar attempt to provide a canonical Q&A to a common question, I would welcome feedback on improving the question prior to posting it. Feedback along the lines of "Appears fine to me" is equally welcome.


1 Windows API only: command line application, GUI application, hook application.

31
  • Where are you going to post that Q/A?
    – rene
    Commented Mar 21, 2018 at 12:15
  • @rene: I don't understand the question. Isn't this Stack Overflow's meta site, that discusses anything Stack Overflow? Or have I completely missed, what you were asking? Commented Mar 21, 2018 at 12:16
  • Is it intentional that the answer to your proposed question is class Program { static void Main(string[] args) {} } for the console app, etc? A minimal application would, aside from Hello World, do basically nothing. Not saying that "what is the most minimal code required for a program to build and run" is an invalid question for SO, but an uncommon one to be sure.
    – BoltClock Mod
    Commented Mar 21, 2018 at 12:24
  • 3
    Is your proposed question intended to be a guide to creating MCVEs for questions? I suspect the reason rene asked where you were going to post it is because even the community is unsure whether these types of questions belong on meta or main. To be clear, I think these types of questions are useful, though care needs to be taken to ensure their purpose is made clear.
    – BoltClock Mod
    Commented Mar 21, 2018 at 12:31
  • 2
    I'm not sure that phrasing this as a real question is serving it well. I think it would do better as an overt, blatant FAQ. (Unless that's the kind of thing that's burned you in the past, I guess.) I'm failing to find it right now, but IIRC there's at least one tag -- one of the popular interpreted languages, I think -- that has a question like this. I could be thinking of their tag wiki, however; although that raises the idea -- if this is small enough, could it go into a tag wiki, or several?
    – jscs
    Commented Mar 21, 2018 at 12:51
  • 3
    That basically reads as just asking how to write an intro tutorial on three different topics. That's...not the kind of thing that belongs as an SO question. I'd say that there are plenty of places that you can go, other than SO, to host an intro tutorial on each of those three topics, but honestly, there are already lots of them out there for those topics. The problem is that people can't find the information on how to create a console application in language X, the problem is just that people don't look for that information.
    – Servy
    Commented Mar 21, 2018 at 13:11
  • 1
    @Servy: That reads like you are not one of those people, that don't look for the information. I'd challenge you to find a single tutorial site, that shows the most minimal implementation of a Windows API GUI application in C++, and explains, why this is the most minimal application. I have looked, far and wide, and have come up with nothing. Even less so any resource, that would then identify points of customization, allowing to add certain classes of functionality. I'm thankful for feedback, but this didn't convince me, that the proposed Q&A belongs elsewhere. Commented Mar 21, 2018 at 13:30
  • 3
    @IInspectable I just typed, "c++ windows application" into google and the first result was this, which is literally a step by step walkthrough of how to create a minimal windows GUI application in C++, with all of the steps individually explained. It even convers your "bonus" material at the end with mentions for some of the more important points of customization one would need to start with.
    – Servy
    Commented Mar 21, 2018 at 13:40
  • 3
    @IInspectable I guess that comes down to a question of definition. Have you actually created a GUI application if it's incapable of rendering a UI? And of course I just looked at the first result. The search is literally filled with different tutorials on how to create a windows application. Again, if you want to create your own, "how to create a windows GUI application" tutorial because you think you can write one that's better than all of those you can, and there are lots of sites out there to host it for you, but SO isn't really suited to hosting content like that.
    – Servy
    Commented Mar 21, 2018 at 13:49
  • 3
    @IInspectable What does SO hosting yet another intro to how to write a windows program tutorial do to impact the low quality questions asked here? People that aren't searching for such tutorials before asking their questions still won't, and so won't be helped by your tutorial, people that do will find lots of existing tutorials out there, and so won't ask a low quality question. If you want your tutorial to be one of the ones people might find, again, there are lots of places you can go to host such content, it's not like it has to be on SO.
    – Servy
    Commented Mar 21, 2018 at 14:00
  • 2
    @IInspectable So you're looking to host a tutorial on how to ask an SO question related to a windows GUI application, rather than how to actually create a windows GUI application. In that case you should be asking a meta question along the lines of, "What code needs to be included when asking a question about a Windows GUI application on SO?" You'd want to perhaps ask about what specific aspects of the application are required, what can be inferred, etc. That then is an on topic and probably answerable question. You obviously shouldn't be asking about different platforms in that question.
    – Servy
    Commented Mar 21, 2018 at 14:12
  • 2
    You cannot ask this question at SO. Consider creating a few minimal github projects that you can link to in a comment. Commented Mar 21, 2018 at 14:48
  • 3
    @JoshCaswell "I'm failing to find it right now, but IIRC there's at least one tag -- one of the popular interpreted languages, I think -- that has a question like this." -- You might be thinking of How to make a great R reproducible example?.
    – duplode
    Commented Mar 22, 2018 at 6:54
  • 1
    While that's a great idea, I think it's going to be either very narrow (having a MCVE for very specific languages and platforms) or a near impossible task (having a MCVE for every language and platform out there). I would suggest a spin - Make a feature request to add an MCVE template to tags (like we have the tag info now), and of course allow members of the community to edit them just like they can edit the tag info. To make it even more useful, I would suggest having having a copy to clipboard link on the top, so that people can easily copy and paste the template to their question. Commented Mar 22, 2018 at 13:57
  • 1
    @ZoharPeled "I think it's going to be either very narrow (having a MCVE for very specific languages and platforms) or a near impossible task (having a MCVE for every language and platform out there)" -- Is that really a problem, though? Wouldn't it be fine to let each tag community do it in their own pace, whenever they feel the need for such a thing? (In any case, I do like the general idea of tag wiki integration.)
    – duplode
    Commented Mar 23, 2018 at 15:18

2 Answers 2

5

I share your frustration with incomplete or non-minimal examples, but I fear that your idea is doomed to failure. I guess you did some research to establish the languages and program types that are most lacking a good MCVE, but it's still hard to see how the standard minimal C++ program:

int main() {}

helps somebody whose problem is "my vector elements don't sort properly", for example. There's nothing there to explain why it's better to construct the vector directly from values rather than to create one and then populate it from an input stream (just to identify one of the many common problems in non-minimal examples).

A tutorial on writing MCVEs is certainly a Good Thing, but it's probably better suited to a blog entry rather than the Q&A format of Meta Stack Overflow. And it certainly seems (IMO) off-topic for SO itself.

1
  • "but it's still hard to see how the standard minimal C++ program [...] helps somebody whose problem is [...] for example" -- On the one hand, the approach of the R folks (a collection of tips) might address such concerns better. On the other hand, the MCVE skeleton doesn't need to be minimal in an absolute way if the parts of it that aren't universally applicable are understood to be illustrative. The approaches might even be combined: a collection of tips accompanied by an illustrative MCVE.
    – duplode
    Commented Mar 23, 2018 at 15:31
2

The comment thread here goes in a thousand directions at once, and it is making my head spin. I feel there is something horribly twisted with how this issue is framed, but I can't quite put my finger on it. That being so, I will just pick some of the comments and riff on them.

Not that I disagree that this is a good idea, but it's sort of hurting my soul that maybe we really have come to the point where people have to spend this much time and effort, not actually answering questions, but helping people formulate the damn things in the first place. [Josh Caswell]

Yesterday I posted a feature request that doesn't have much to do with your post, except that it also deals with improving questions. While it got a more negative reception than I had expected, I can sympathise with the Weltschmerz expressed by Hans Passant in the discussion over there, which now reappears in Josh's comment. The -- valid, and serious -- concern is that too much hand-holding can drag us down a rabbit hole, in which the mission of this community is forgotten. For the purposes of this answer, though, I will provisionally assume it is possible to have canonical questions about how to build MCVEs that don't get us one step closer to the abyss.

That basically reads as just asking how to write an intro tutorial on three different topics. That's...not the kind of thing that belongs as an SO question. [Servy]

You cannot ask this question at SO. Consider creating a few minimal github projects that you can link to in a comment. [Hans Passant]

More pitfalls. You definitely don't want your question to become anything like a Windows API tutorial -- we're walking a thin line of quasi-Meta content here. It is also doubtful whether it is a good idea to disjointly combine your three use cases in a single Q&A. The specter of hand-holding reappears here: by making your guidance overly concrete (e.g. with ready-made code skeletons that can be copy-pasted), you risk ending up with something too narrowly scoped to be useful, or too broadly scoped to be manageable. For a different -- and seemingly successful -- take on this task, see How to make a great R reproducible example?, and also the discussion about it in Where should “How to create a good reproducible example in …?” questions reside?. (It is worth noting that even that R FAQ Q&A has been criticised for "being too demanding from beginners", which is yet more fuel for Weltschmerz.)

While I have no problem coming up with the answer, I'm looking for feedback on the question, so as to not let it fall victim to down- or close-votes, due to various reasons. [...] Having been burnt in the past with a similar attempt to provide a canonical Q&A to a common question, I would welcome feedback on improving the question prior to posting it. [IInspectable]

I'm not sure that phrasing this as a real question is serving it well. I think it would do better as an overt, blatant FAQ. (Unless that's the kind of thing that's burned you in the past, I guess.) [Josh Caswell]

Not asking a genuine question was indeed part of what got me penalized last time around. It sounds weird to me, too, kind of like talking to myself, and everyone can watch me go insane... [IInspectable]

I have spent the previous two paragraphs speculating about the various ways in which your question might go wrong. You may have noticed, though, that I didn't mention close votes at any point. That's because, in my understanding, once someone intentionally and explicitly sets out to create a canonical Q&A, the rules of the game change. Canonicals call for a different set of questions to be asked about them, such as "Will this Q&A be actually useful as a reference within Stack Oveflow?" and "Is the scope of this Q&A overly ambitious?". While those questions might resemble what we ask of garden-variety questions in our daily moderation tasks, the evaluation is framed in a quite different way.

You might now be wondering about exactly where I pulled "the rules of the game change" out of. It follows from a firm tenet of my understanding of Stack Overflow: close reasons are means, and not ends. For instance, we claim that the usual asking guidelines remain relevant for self-answered questions not out of some sense of heavenly absolute justice, but merely because that leads to better self-answered questions. As for canonical questions, they are a sufficiently different kind of beast that inflexibly applying the usual rules won't necessarily lead to improvements. (For additional remarks on that, cf. the answers to Posting an intentionally too broad/unclear catch-all question.)

What if, even after carefully planning your canonical, you still get demands to talk to yourself, or to keep questions equal by hatchet, axe and saw? Fight back. Defend your question in the comments. Exhort the voters to use their common sense. Raise hell on Meta, if you must. You'll find in due course whether your plan is as good as you thought at first, and which, if any, adjustments are worth making. Just don't let literalism win by default.

11
  • An excellent point about not letting the means become their own ends. As when "All causes get conflated into a shapeless mass of negativity", this seems to be a rut that groups of humans just fall into naturally. I suppose our brains are trying to save energy on thinking.
    – jscs
    Commented Mar 22, 2018 at 13:11
  • 1
    We should be better than that, be creative, and use what tools we have in ways that improve the situation, not worry about the rules for their own sake. In short, just post the FAQ.
    – jscs
    Commented Mar 22, 2018 at 13:11
  • 1
    @JoshCaswell On a tangential note, the thread you link to in your second comment is, as most NAA discussions here, headache inducing. The funny part of it is that such discussions waste, rather than save, energy on thinking.
    – duplode
    Commented Mar 22, 2018 at 14:05
  • 2
    "once someone intentionally and explicitly sets out to create a canonical Q&A, the rules of the game change" That's just false. You can't just decide, "this question isn't going to bother following the rules" and have them not apply. That's...not how rules work. The design of SO is that all (good) questions are the canonical version of that question. They're still expected to be appropriately scoped (and on topic, not subjective, and all that other stuff). If everyone could just decide that the rules don't apply to their question this would just be Yahoo Answers.
    – Servy
    Commented Mar 22, 2018 at 14:13
  • @Servy (1) "That's...not how rules work." -- That's how some rules work: they leave some margin for reasoned human interpretation in tricky corner cases. If you allow me an hyperbolic analogy, that's why courts of law require human judges. (2) "The design of SO is that all (good) questions are the canonical version of that question." -- That's an interesting way of formulating this stance. In the light of it, how do you see Robert Harvey's remarks here, or, indeed, the mere fact that we bother with canonicals as a separate concept to begin with?
    – duplode
    Commented Mar 22, 2018 at 15:32
  • @duplode Sure, if a rule specifically includes exceptions, a rule can have exceptions. You're saying that someone can just decide that the rules shouldn't apply to them, and because they decided as much, the rules immediately stop applying to them. That's different. To go with your analogy, you're not allowed to just declare yourself above the law, because it's convenient to you.
    – Servy
    Commented Mar 22, 2018 at 15:39
  • As for Robert's answer, I disagree with his approach of trying to think of canonical and non-canonical questions. There is no such distinction in any of the rules or official guidelines, and it's not a useful description of questions as he's using it. Some questions are more or less broad, but they're all supposed to be the canonical version of that problem, even if it's a narrow problem. I would prefer to describe the situation he's describing as a broader (but not too broad) question, not a "canonical" question. Of course how broad is "too broad" is not an easy question to answer.
    – Servy
    Commented Mar 22, 2018 at 15:40
  • 1
    @Servy It is not about askers one-sidedly deciding the rules don't apply to them, but rather about the community refining its decision making so as to not stand in the way of a specific kind of potentially useful and unproblematic Q&As. I believe question closure is a domain which is narrow and subsidiary enough to make consequentialism pay off.
    – duplode
    Commented Mar 22, 2018 at 15:50
  • @duplode But that's not what you said, you said that as soon as someone just decides to call their question a canonical question (even though, as I mentioned, all questions are supposed to be the canonical version of that question) the rules stop applying to it. Questions need to be of a sufficiently narrow scope, and while there can be debate about how broad is "too broad", it doesn't matter who's asking the question, why they're asking it, whether they know the answer, etc. when determining if it's too broad or not.
    – Servy
    Commented Mar 22, 2018 at 15:56
  • @Servy When I mention "intentionally and explicitly [setting] out to create a canonical Q&A", I assume the asker is acting in good faith (and not just looking for an excuse to get an inappropriate question past the rules) and with a minimal level of competence (so that the resulting question is in fact recognisable as at least an attempt at a canonical, according to the typical understanding of what a canonical is). If those two conditions aren't met, the community obviously has no reason to adjust any criteria.
    – duplode
    Commented Mar 22, 2018 at 19:41
  • 1
    @duplode Again every question is supposed to be the canonical version of that question. The rules that exist, exist for canonical questions. They don't exist for all of the questions that shouldn't be canonical questions. SO's rules for how to ask a question are there because doing those things is how you ask a good canonical question. A question's quality is not based on the intent of the author. Someone trying to ask a bad question can ask a useful question, and vice versa. That someone tried to ask a good question, but asked one that's too broad, etc. still merits closure.
    – Servy
    Commented Mar 22, 2018 at 19:48

You must log in to answer this question.

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