1

Let's create a new canonical, community-wiki style question. The title could be "How do I use a debugger to debug my own C++ code?"

Here is an example question that I would like to mark as duplicate to it: https://stackoverflow.com/questions/28449838/where%C2%B4s-my-error-recursive-prime-factorization. This is the 3rd such question I saw in the last hour.

The benefits of such a community wiki is that it could provide links to videos (such as Basic Debugging with Visual Studio 2010), tutorials etc. which show how to use a debugger, as I believe many of the question askers are just learning programming and they legitimately don't know that such an animal as a debugger exists, or they've never used one. So pointing them to a link that helps them.

If there is consensus giving me a green-light, I will create an initial question and answer it myself right away. I'm sure there will be no shortage of C++ questions to be marked as duplicates.

17
  • 1
    I thing that it won't prevent such questions because you can't look for something you don't know. But then we'll be able to drive them to the good question with pertinent answers. I'm in! Commented Feb 11, 2015 at 8:58
  • 3
    The only problem I have with this is that duplicates are not cleaned up like other closed questions. Many of these questions are currently probably closed with the "off topic -> minimal example" reason (like the linked question) and thus get auto-deleted and don't clutter up the site or the google search results. Once you start closing all of them as duplicates, they have to be deleted by the community or stay around; even though they're completely useless as signposts.
    – l4mpi
    Commented Feb 11, 2015 at 9:14
  • @l4mpi They're not clutter. They serve as "signposts"—different ways of phrasing an original problem. Many duplicates are well-worded, original takes on a similar problem, and having them all leading to a single, canonical answer is a resource, not a burden. Commented Feb 11, 2015 at 9:15
  • @l4mpi But imagine if in the future typing "Help my code is not working" brings "How do I use a debugger" on top of Google because of the linked questions' content. That would be pretty awesome magic.
    – sashoalm
    Commented Feb 11, 2015 at 9:15
  • 2
    @AlexisKing did you read all of my comment? They are completely useless as signposts, just look at the linked question. Nobody is ever going to find that when attempting to debug anything (not that most of them even search); but it clutters up the search for "recursive prime factorization". Similarily, "help my code is not working" cannot reliably link to "how to debug" because debugging heavility depends on if you're using C++ or JS or Python or Lisp or Prolog or any other language.
    – l4mpi
    Commented Feb 11, 2015 at 9:23
  • @l4mpi Obviously, use disgression. There are questions that are simply utterly useless. There is no need to keep them around. High-rep users can always vote to delete questions that are especially poor. If something like that becomes a problem, it can be managed, but it's a waste of time to consider such exceptional cases before they even occur. Doing something like this provides far more benefit than harm. Commented Feb 11, 2015 at 9:26
  • There are a lot of C++ compilers you'll have to cover. Useful and practical answers surely will be "Find an IDE". High odds that it is going to get closed. Commented Feb 11, 2015 at 9:28
  • 1
    @AlexisKing The thing is, these are not "exceptional cases", but rather the norm. I'd wager that any question which gets closed as a dupe of "I'm so new to programming that I don't even know what debugging is" is completely useless. I'd rather say a high-quality, useful, signpost duplicate of the question OP intends to create would be the exception. Feel free to collect examples of such questions to prove me wrong.
    – l4mpi
    Commented Feb 11, 2015 at 9:31
  • @HansPassant Can't the answer just list VS and gcc? Those cover 99% of the cases. Additionally, I'll cover Turbo C, as I'm from eastern europe and I know the pain of university professors insisting on their students using it (and I know it's a practice in India as well).
    – sashoalm
    Commented Feb 11, 2015 at 9:32
  • @l4mpi By "exceptional cases," I don't mean poor questions—obviously poor questions vastly outweigh high-quality ones—I mean the situation you proposed in which the existence of those questions actually causes problems. A close question is, for most purposes, gone. "Clutter" is a low-priority problem on SO. There's lots of clutter, and that's a fact we live with. It doesn't really impact the functionality of the site. Commented Feb 11, 2015 at 9:34
  • 3
    @AlexisKing Your assesment that clutter is not a problem for SO may be your personal opinion, but it differs heavily from my experience in the past years - the amount of crappy questions I come across when researching something on google is getting worse. Combine that with a lower search ranking for SO in general (see meta.stackoverflow.com/q/280328/1110381) and it's quickly becoming a problem that will only get worse with time.
    – l4mpi
    Commented Feb 11, 2015 at 9:41
  • @l4mpi Do closed questions really get auto-deleted, though? Without voting to delete I mean? Because I've seen plenty of old closed questions. I've never heard of auto-deleting closed questions.
    – sashoalm
    Commented Feb 11, 2015 at 10:34
  • @sashoalm meta.stackexchange.com/a/177675/226398 and afaik the criteria have even been tuned recently to more agressively delete closed questions (IIRC the answer requirements were raised, but I can't find the relevant post atm). But note the "not closed as a duplicate" - dupes are explicitly exempt from cleanup, which is what I'm lamenting here.
    – l4mpi
    Commented Feb 11, 2015 at 10:39
  • @sashoalm dups only get deleted by the roomba if they have no answers, score less than 0, and fewer than two comments. If any of those criteria are met, the dup will remain until delete votes are cast on it (... and then a mod undeletes it). ... Aside, please look at stackoverflow.com/questions/linked/218384?lq=1 for the joys of crap dups.
    – user289086
    Commented Feb 11, 2015 at 14:01
  • Read the answers to meta.stackoverflow.com/q/265500/1048572 - your question probably would require a book chapter answer. If you can bring one up, it might be ok, but a link-only answer won't be accepted.
    – Bergi
    Commented Feb 11, 2015 at 14:12

3 Answers 3

12

A list of links to videos? Ugh. Why do we even need this?

In general I'm not opposed to this idea. I've told many people to learn some debugging before coming back to the site with yet another question to be closed. Having somewhere I can bring them to that explains what that "debugging" thing is would be nice.

I don't like this incarnation of it, though.

I'll start by mentioning that we already have a specific close reason for these questions that doesn't involve duplicates:

Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers.

To put it bluntly, the question linked here as an example just doesn't belong on the site. That's it. There's no lasting value gained by keeping it. I haven't deleted it yet only for the sake of discussion; under normal circumstances, I would.

That said, let's say we prefer to close by linking people to a duplicate.

So people will follow the link to the duplicate and find some list of links to videos and presumably follow one or more of those and watch them. Seems ok, but I have a few reservations about this, which are reservations against both the idea of linking to external content instead of providing it directly in the answer, and reservations against the video format.

Any regular old answer on SO can be improved by others. I can fix mistakes in answers, I can update outdated information, I can add missing information. This is by virtue of primarily two things: the information is in an easily editable format (prose), and it is right here on the site where I can edit everything, more or less.

A video cannot be improved as easy as prose. I can improve some prose while waiting in line at the post office. A video? Haha, good luck. An external video, though, is even worse: I would need to make my own video that would be a complete replacement for the existing one with the improvements I thought necessary and then replace the link to it.

Especially for a canonical answer, I really would prefer content I can directly improve here on SO. Canonical answers have to be top-notch. They are meant to be linked often, so they cannot be just average. They have to be the best. And curation is essential to keep that content as the best. A list of links to videos severely undermines the ability to keep the content at the level of quality it needs to be.

7
  • There was an unspoken reason - a duplicate link makes an auto-comment, which other close reasons do not. The auto-comment is a blue link and very easy to see, and I've noticed it makes others more likely to close and downvote, while the other close reasons just put a discreet "close (1)", which is easy to miss, and it's only seen by those with 3000+. Also the duplicate lists the reason to close, while you need to click on the "close (1)" for the others.
    – sashoalm
    Commented Feb 11, 2015 at 11:22
  • 2
    @sashoalm so what? All of that doesn't matter once the question is closed.
    – l4mpi
    Commented Feb 11, 2015 at 11:23
  • @l4mpi "once the question is closed" - you nailed it. Only it got 2-3 answers and those answers got rep, and the OP accepted one and the question fell off the front page before 5 votes accumulated.
    – sashoalm
    Commented Feb 11, 2015 at 11:25
  • 8
    @sashoalm so what? That is the norm even with the most crappy questions. It's a normal occurence for bad questions to get answers and even upvotes before being closed, happens hundreds of times every day. With duplicates I've found it accumulates even more pity upvotes than other close types; people probably think "oh it's a good question, OP just didn't find the dupe" instead of "that crap should be deleted on sight". What you describe is a problem with the community, not with which close reason is picked.
    – l4mpi
    Commented Feb 11, 2015 at 11:28
  • @l4mpi Well, you've heard my opinion and I've heard yours. Let's agree to disagree, shall we? You think they shouldn't be marked as duplicates, I think they should. I don't think there's anything more to say.
    – sashoalm
    Commented Feb 11, 2015 at 11:35
  • @R. The answer can be edited, why don't you remove the video links then? I don't insist on them.
    – sashoalm
    Commented Feb 11, 2015 at 11:36
  • 1
    Because I don't have time to do everything, and especially not to summarize that kind of video content. Commented Feb 11, 2015 at 11:39
2

Canonical questions are encouraged on the Stack Exchange network, especially so on Stack Overflow in which so many duplicate questions are frequently asked. To quote Benjamin Gruenbaum:

Just do it.

The difficulty here is not getting the approval that this is a good idea—it almost indisputably is a great idea—the trick is actually writing such a good, high-quality, canonical answer. For some examples of successful canonical questions, see these examples:

For a number of these, I see many questions getting closed as duplicates to the above every single day. Many of them have an immense amount of work put into them. In order for these questions to "catch on" as canonical questions, they need to be well-written, they need to be complete, and perhaps most importantly, they need to be used as targets for duplicates.

Write a good answer. Make sure it's polished. Then close every question in sight that is a valid duplicate of the given problem.


To those claiming that such a question would be off-topic: yes. Maybe it would be. But the rules have been proven to be a little squishy in the past. I'm looking at you, The Definitive C++ Book Guide and List.

Sometimes a question's on-topic-ness can be outweighed by its usefulness. It just needs to have a really good answer. Anything less isn't going to cut it.


As a final note, if you actually spend the time writing a really good answer, you don't necessarily need to make it community wiki. You can if you'd like, but if you put effort into it, you deserve the reputation just like any other question/answer.

8
  • OK, I'll try posting it, hopefully it doesn't get rejected. We really need something to mark all those questions as duplicates.
    – sashoalm
    Commented Feb 11, 2015 at 9:56
  • I posted it - stackoverflow.com/questions/28451362/…
    – sashoalm
    Commented Feb 11, 2015 at 10:30
  • @sashoalm I'd upvote, but I'm out of votes. :x Commented Feb 11, 2015 at 10:33
  • What's important is it doesn't get closed. I'm sure there will be some disagreement on this question, it seems a controversial topic.
    – sashoalm
    Commented Feb 11, 2015 at 10:35
  • That the rules have been squishy some six years ago doesn't imply anything about the rules today. That's a really poor argument, especially when taken into consideration the fact that those are some six years devoid of other such similar examples. Commented Feb 11, 2015 at 10:50
  • @R.MartinhoFernandes Every single one of those answers continues to be a valuable dupe-target. What's to lose? A community-guided effort for productive gain is helpful. Blindly adhering to rules 100% of the time is madness. If anything, I'd like to see more canonical answers. Commented Feb 11, 2015 at 10:53
  • @AlexisKing While I agree that blind adherence to rules is not a good idea, I posit that blind divergence from the rules is a worse idea. Understanding why the rules exist first is an important step for responsibly straying from them. Commented Feb 11, 2015 at 11:26
  • @AlexisKing Aaand the question just got closed :)
    – sashoalm
    Commented Feb 11, 2015 at 11:32
0

Following @Alexis King's suggestion, I did write a Canonical Question - https://stackoverflow.com/questions/28451362/how-do-i-use-a-debugger-to-fix-my-c-code/28451363.

It can be used to mark other questions as duplicates to it, or simply written as a comment in case marking such questions as duplicates is not good for the site for SEO reasons.

Some commenters said that closed questions eventually get auto-deleted but duplicates do not, though I think I've seen plenty of non-duplicate questions that aren't deleted.

Now we can wait and see if it flies or gets closed.

1
  • The roomba rules won't delete a closed question with an up voted or accepted answer (ever). While it is possible to "correct" upvotes in small numbers - questions with accepted answers require delete votes because the roomba will never delete them itself. See also meta.stackoverflow.com/q/262077
    – user289086
    Commented Feb 11, 2015 at 14:06

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