30

This question hit the Hot Network list:

What does this colon mean? It is not labeling, it is not ternary operator

The question is, basically, about a strange looking syntax found in a C++ book's example. The answer is, equally basically, that it's a misprint or a typo in a book.

There is an off-topic close vote reason (with currently 2 votes) for "typo" questions, which reads:

This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was 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.

Normally I would close vote it as a typo question because it's a typo, the three answers agree it's a typo, and, well, it's a typo. But there is also a highly voted comment from a moderator which reads:

Moderator Note: Please think very carefully before casting a vote to close this as a "typo" question. Yes, the problem is a typo, but it's not a typo that the asker made. Rather, it is one found in a published book. That means this question and its answers may well be useful to others in the future, which is a strong counter-indicator for closing it as a typo.


Errors in books, newspapers, and other published sources are corrected by the publisher in errata. This isn't hard to find, generally; a simple web search for "<name of textbook> errata" will usually bring up something. That is, in my experience, publishers won't make it difficult to find this information, hide it behind paywalls, or try to hide it.

Not just that, but the actual answer to the question points to the errata for the book in question and reproduces the 'corrected' version of the original code.

So, my question is: if a question is about code from a published source (eg. a textbook), and the issue is due to a typo in said published code, does it still fall under the purview of the general "off-topic" close reason for "typographical error"? And, if this is the case, shouldn't the guidance for this close-reason be updated to include this exception?

16
  • 7
    a typo is a typo is a typo. The answer being useful doesn't make it not one.
    – Kevin B
    Commented May 1, 2019 at 19:51
  • 8
    "While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers." Commented May 1, 2019 at 20:05
  • 3
    just another case of HNQ prioritizing a low quality QA because it's interesting.
    – Kevin B
    Commented May 1, 2019 at 20:34
  • 2
    Closely related: Are questions that boil down to errors in off-site resources on-topic?
    – duplode
    Commented May 1, 2019 at 20:52
  • 7
    We have a "too broad" close reason. And we used to have a "too localized" close reason. But that one got removed by the bosses, it was used too often. Requiring another way to label a question that is truly useless to anybody else, that became "typo". Typos that are not too localized are on-topic. Commented May 1, 2019 at 22:10
  • /me proposes a "too noobish" close reason. Commented May 1, 2019 at 22:37
  • I remember that, and it's a nice bit of trivia, but it contradicts the close reason. Unless I've misunderstood the example in the question, dumping the example into a file and trying to compile it would cause an error message along the lines of "unexpected token". That's not a useful question. A typo which actually meant something in its altered state I'd see as useful. Commented May 1, 2019 at 22:38
  • Not really. When you say "off site resource" I think "websites". Websites (usually) do not have published errata. Textbooks (usually) do. Also this isn't an error. It's a typo. Commented May 1, 2019 at 23:40
  • OK so since this is now a duplicate, I guess the answer is actually "Yes, off-site and published resources are excluded from the 'typo' close reason." Or something, idk. Commented May 2, 2019 at 2:19
  • 4
    also even if errata is published online, the publisher can go out of business, making their site unavailable in future, so keeping the question may be helpful for new learners
    – Jeffrey04
    Commented May 2, 2019 at 9:01
  • I guess that is a valid point, and why we discourage link only answers, in case both the site and archive.org disappear. Guess it's just worthy of the 'attempted no research' down vote. Commented May 2, 2019 at 13:54
  • 1
    @KevinB the point of close rules is to get rid of questions that aren't useful. If the typoness of the typo outweighs the usefulness of the answer, then something is wrong. It strikes me that the critical aspect of the rule is "unlikely to help others" rather than the presence of a typo.
    – phoog
    Commented May 2, 2019 at 17:25
  • @phoog and in my opinion, that question and its answer is not going to be a useful artifact to keep around, so the reasoning fits.
    – Kevin B
    Commented May 2, 2019 at 17:27
  • 3
    omg what have I done ^^" I am the author of that question. I did my research on the different uses of colons, through StackOverflow, cpp-reference, etc... Even the C++ iso! But I confess I had not thought it could have been an errata. It did seem to me like a C++ "smart" construction. I could have run many experiments to figure out its behaviour, but I opted to look for its documentation. And since I only found the typical uses of colons, and not the one I looked for, I posted it in Stack overflow. Voilà my way of reasoning, in case it helps your discussion!
    – Piockñec
    Commented May 2, 2019 at 21:53
  • 2
    Also relevant to the worthiness of keeping the question is the reality that this is not just "a" book. This is pretty much "the" book for the language.
    – David
    Commented May 2, 2019 at 22:59

4 Answers 4

67

I am full-out shocked that the applicability of the "typo" close reason here is at all controversial.

I will start by reminding you that our mission is to build a library of high-quality answers to practical programming problems. The idea is that, rather than just helping one person (a la a help desk), we are helping an imaginably infinite number of future people who have the same (or similar) problem.

If a well-respected book about a major programming language has a typo that has confused one beginner, then it stands to reason that others who are reading the same book might have the same confusion, leading them to seek out an answer. Wouldn't it be nice, then, if we had a high-quality answer already on tap for them to benefit from?

That's the high-level view. I think that stands alone as justification for keeping the question. Note that it's not altogether different from this case, where the fact that the problem arose from a typographical error is irrelevant. What is relevant is that others are likely to have the same problem and would therefore benefit from having an answer.

For pedants who like to lawyer over rules, let's analyze the close reason. You quoted in the question, but here it is again:

This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was 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.

When analyzing the applicability of a close reason, it is essential to read both the bolded and non-bolded portions.

The middle sentence here is the strongest counter-indicator of the close reason's applicability to this particular question, and the one I cited in my original comment. It's also the big idea that I spent several paragraphs discussing above. Our primary goal is to help future readers, with helping the original asker being a nice (and not unintended) benefit. So, if the resolution of a typographical error would benefit future readers who are likely to have the same (or similar) question, then the question is suitable for Stack Exchange and should almost certainly not be closed under this reason.

Naturally, there is a bit of subjectivity in this, which is why I worded my original comment on the question the way that I did. I didn't want to make an absolute pronouncement that no one should vote to close the question. Rather, I wanted to emphasize the importance of the "resolved in a manner unlikely to help future readers" phrase. If you believe that the resolution of the question is truly unlikely to help future readers, then close away. But don't close because "oh, it's a typo", because you forgot to read the rest of the close reason.

Failure to read or properly understand this part of the close reason is what led me to suggest tweaking the emphasis placed on various phrases in the "off-topic" close reasons, including this one. I still think both of those proposed changes are a good idea; thanks for reminding me of that.

The raison d'être of the "typo" close reason is to capture questions that were resolved in a manner unlikely to help future readers. It is the modern-day equivalent of the old "too localized" close reason that was widely misused due to its excessive generality. In the modern-day equivalent, it has been contextualized with the most common reason why a question would be unlikely to help future readers—it arose out of a typo. The purpose of the close-vote reason is still the same. It is shooting ourselves in the foot to close and/or delete questions that are suitable for our format and would be helpful to future viewers.

If you read further in the close reason, you come to the third sentence. This suggests that the way to avoid asking a question that will be closed for this reason is to create a MCVE and debugging it. Well, in this case, the asker pretty much did that. What more would you want them to do? They didn't dump their entire project's code in the question and ask you to debug it for them. They didn't have a missing semicolon somewhere in the whole mess that was leading to a messy and irrelevant slew of compiler errors. It didn't arise out of their own sloppiness or carelessness or lack of diligence.

The observation has been made that published sources have errata. The supposed implication is that:

  1. The asker should have done their own research, found the published errata, and answered the problem themselves, and/or
  2. The existence of this errata, published elsewhere, makes having the question on Stack Overflow superfluous, as it already has an answer elsewhere.

Don't look now, folks, but that applies to pretty much every question on this site. It is exceptionally rare to break new ground here (and our format is not designed to encourage it); most of what we answer has already been answered somewhere else. So this is a very poor reason to argue that a question is off-topic or should be closed. Again, the point of Stack Exchange Q&A sites is to aggregate that information, distill it into relevant, helpful chunks in the form of answers to specific questions, and have it vetted for correctness and helpfulness by other community members.

Mark Benningfield suggests that perhaps the question should stay open because apparently many people are not aware of the existence of technical errata. I don't know if his motivating assumption is correct or not, but his larger point certainly is. Stated a bit more generally, and at the risk of repeating myself: if the answer would be helpful to others having the same problem, then the question should be answered.

Mark also raises the consideration of downvoting the question because of "lack of effort". That's your right, as always, and is indeed a customary reason for downvoting, but I'm not entirely sure that I agree. I challenge you to find a syntactical question in the tag that cannot be answered by consulting the language specification. Arguing that the question is bad because it has an answer strikes me as rather twisted logic.

This wasn't the sort of low-effort question that we all bemoan. The asker didn't dump his homework or project requirements into the textbox, implicitly asking us to build it for them. There is even evidence in the question that they engaged their brain (!), reasoning through all the uses of the colon that they knew of in the C++ language to try and figure out what this one might be. If you're criticizing them for lack of effort, consider whether you are really criticizing them for knowing less about the C++ language than you. And then consider whether that's really an appropriate criticism.

To answer your specific question here, no, questions about published code should not be added as an "exception" to the close-vote reason, because the close-vote reason already contains sufficient language to allow you to use your brain. The purview of the "off-topic" close reason is to dispatch questions that are actually off-topic for Stack Overflow, because they are unlikely to be of help to future readers. There is no need for an exception once you are properly applying the decision rule.

15
  • 1
    I think this reasoning can be equally applied to any typo someone might make that other developers could commonly make. It's useful to everyone else who made this mistake!
    – Kevin B
    Commented May 1, 2019 at 20:50
  • 4
    It seems that would be a valid argument against the closure of those questions, if the argument could be sustained and was persuasive to others knowledgeable about the technology. This is just a special case of the more general fact that we don't care about the genesis of a question on Stack Overflow. We only care about the presentation of the question and its answers.
    – Cody Gray Mod
    Commented May 1, 2019 at 20:53
  • 2
    This would make sense if books were static entities... they are not. Erratas, editions, corrections, reprints, and others good ol' obsolescence reasons. This kind of thing, should be on the comment section of the book, or the publisher errata mail.
    – Braiam
    Commented May 1, 2019 at 21:42
  • 12
    That's true of language specifications and API documentation, too, @Braiam. Does that mean we're all out of business?
    – Cody Gray Mod
    Commented May 1, 2019 at 22:13
  • 1
    Do you really find typos on documentation and specs? I would be impressed if you find one, given that they have several reviews.
    – Braiam
    Commented May 2, 2019 at 1:50
  • 11
    @Braiam Yes, I find mistakes in documentation quite regularly, actually. But that wasn't my point. I interpreted your comment as saying that because books aren't static entities, but constantly changing, any answers that we write about them would quickly become obsolete. My point was that none of technology is a static entity; everything we deal with here is rapidly changing and thus obsoleting our answers. It's not a problem that there is a good solution for, but I don't think it means we should stop trying to answer those questions. Or did you mean something else?
    – Cody Gray Mod
    Commented May 2, 2019 at 2:12
  • 8
    @KevinB I vaguely remember an older discussion about that topic. The key point is, that even when a lot of programmers make the same kind of typo, the result usually looks different and the programmers would be unable to find older questions about the same typo, unless they already realized that this is a typo and hence, what keywords to reach for. This is what makes most typo questions worthless for future readers. The situation is entirely different when the typo is in a named resource, which makes reliable keywords to search for, and a fixed piece of code with the same symptoms for everyone
    – Holger
    Commented May 2, 2019 at 10:50
  • 1
    It might be nice to have some examples of where the type close reason is and is not applicable. Perhaps there is another way to generalize than "external resource" or "published code." For example, it clearly applies to "Why doesn't this compile (int result = 4; return reslut;)?" But it doesn't apply to the period-vs-mid-dot question you link to. In law, statutes are sometimes intentionally vague, allowing judges to make, well, judgment calls. The problem with that here is that any 5 people can close a question, so a vague rule virtually guarantees closure in ambiguous cases.
    – phoog
    Commented May 2, 2019 at 14:26
  • 3
    Which is why we also allow questions to be re-opened, @phoog. There's always some subjectivity in the decision, for all of the close reasons. This is probably one of the least subjective in terms of what it covers. I give some examples at the very bottom of this question, to which I linked. The hope is that "not useful to anyone else" will be a pretty easy-to-apply decision rule.
    – Cody Gray Mod
    Commented May 2, 2019 at 17:20
  • I wonder about the resolution of a typographical error would benefit future readers who are likely to have the same (or similar) question. Doesn't that describe the incredibly common if (var = value) mistake, which we routinely close as typos? Or is the difference that the questions aren't directly about that mistake, because they didn't even realize it was an issue, and no amount of searching would find similar questions?
    – Barmar
    Commented May 2, 2019 at 20:09
  • 1
    If the fundamental issue really is the use of the assignment operator where the equality operator is meant, then the question seems better off being closed as a duplicate of a canonical that explains the difference. So, in other words, no, this is not altogether different, since that is also a common problem that people have. However, in the case that the question is just a dump of code so cluttered with errors that you can't even be sure that's the only one, then closing as a duplicate doesn't make much sense. 'Course, neither does closing as a typo. Close as "too broad"/"no MCVE". @Barmar
    – Cody Gray Mod
    Commented May 2, 2019 at 20:49
  • They're usually something like "Why doesn't this work?" or "Why doesn't else work?"
    – Barmar
    Commented May 2, 2019 at 20:55
  • @Barmar I guess, when you search for “Why doesn't this work”, you’ll find a lot questions entirely unrelated to your actual problem.
    – Holger
    Commented May 3, 2019 at 6:28
  • 2
    Perfectly explained. And it's worth noting that sometimes the errata doesn't contain the error being asked about. In which case SO is likely the only source for the correction. Commented May 3, 2019 at 7:10
  • 2
    @Braiam How many reviews do you think this book had before it was released? "Several" suggests to me a number less than 10. I would have expected this code to have been looked at between 10 and 20 times. The typo still slipped through. Commented May 3, 2019 at 7:52
19

If anything, it could conceivably be downvoted to oblivion based on "Lack of Effort", since, as you say,

Errors in books, newspapers, and other published sources are corrected by the publisher in errata. This isn't hard to find, generally; a simple web search for " errata" will usually bring up something. That is, in my experience, publishers won't make it difficult to find this information, hide it behind paywalls, or try to hide it.

However, I have answered a similar question in the tag, because it seems that a significant portion of the population has no idea that the concept of technical errata even exists, so I think that it would be helpful to future visitors for that reason. As such, I don't think "Typographical Error" is justified as a close reason.

2
  • 3
    "it seems that a significant portion of the population has no idea that the concept of technical errata even exists" yeah, the compiler is always right, except when it's not.
    – Braiam
    Commented May 1, 2019 at 21:43
  • Thank you; agreed. I admit that I'm one of those people for whom it would probably never occur to search for "C++ errata", especially if I'm presuming that there the example is correct, and that I simply don't understand it.
    – David
    Commented May 2, 2019 at 23:01
8

Though I don't have a strong opinion on this, I lean towards considering "Off-topic/Typo" as not being applicable here. A typo in code within a book is roughly analogous to a bug in a library, and the consensus is that questions about the latter are on-topic (for instance, see Should I delete my question if suspected it's a bug by the library?, which is one among many Meta questions dealing with that issue). Imperfections of the analogy aside, there can be some long-term value in documenting a programming-related error in a book in an easily accessible way, as argued at length in Cody Gray's answer. See also Peter Cordes' answer to Are questions that boil down to errors in off-site resources on-topic?

There certainly can be reasonable considerations about the usefulness of questions about typos in books, and how it is influenced by various factors (such as the notability of the book and the subtlety of the typo). However, I feel those matters are better dealt with using upvotes and downvotes, rather than through closure.

2
  • But in this case, the typo was corrected in later editions of the book. Which in your analogy makes it comparable to a bug in a previous version of a library.
    – Mr Lister
    Commented May 2, 2019 at 20:17
  • 3
    @MrLister We don't close questions because they are about older versions of software. That aspect does get across the analogy. In fact, in some cases upgrading your copy of a book can be difficult (for instance, it might have gone out of print), counterproductive (books sometimes get worse with newer editions), or simply not worth the trouble (why get rid of a perfectly good book just because of a handful of typos?).
    – duplode
    Commented May 2, 2019 at 22:33
-10

Yes, the question can certainly be useful to other people who have this particular version of the book who aren't aware of the ways publishers present fixes to problems like this, however, it by nature is still just a typo and was solved in the same way all other typo problems are solved... "That's a typo."

Closure in this case will not remove the question from google search results, nor will it prevent users who have this problem from finding the question. I believe it should be closed, then at a later time when it is deemed no longer needed (if that ever occurs) people with enough reputation to do so can delete it. Until that time, it is protected from auto deletion by the votes it has received.

There are many very useful questions on SO that are closed but still frequently visited. I think this one should join them.

6
  • 14
    So, then, what's the point of closure? All it's doing is preventing anyone who might be able to contribute a better answer from answering it. Like if Bjarne rolled up and had an interesting story about how that typo arose.
    – Cody Gray Mod
    Commented May 1, 2019 at 22:14
  • What are the odds of that happening? Would his answer provide anything useful to the question that wasn't already there? There's no need for additional answers here. It's a typo that the author has recognized and fixed.
    – Kevin B
    Commented May 1, 2019 at 22:24
  • 1
    Not sure why this was downvoted so much. A typo is a typo. Close it as such. Especially since the answer to the question discussed shows that there are already 2 newer version of the book. So the question asker should've gotten him-/her-self up-to-date resources. A typo is a typo. We all use IDE's to help is detect them and correct them before going further than a local version control branch. Vote to close and be done with it? ...
    – rkeet
    Commented May 3, 2019 at 7:34
  • 1
    @CodyGray In your opinion, knowing the question has an answer pointing to 2 newer versions of the book than the one used by the questioner, both of which have that example corrected, what could possibly be an improvement to that extremely localized off-site resource?
    – rkeet
    Commented May 3, 2019 at 7:36
  • 2
    @rkeet The biggest improvement would be providing free access to the current published version of all books to everyone in the world, without any economic disparities. Until that utopia is realized, I don't see the fact that a newer edition has been released as obsoleting the question. Your argument that "a typo is a typo" makes very little sense. You are either ignoring the real purpose of that close reason, which is to close questions that will not be useful to anyone else. Saying that people use IDEs to help them correct typos suggests you either aren't a C++ programmer or have no...
    – Cody Gray Mod
    Commented May 3, 2019 at 16:20
  • ...sympathy for what a beginner might go through in trying to compile code copied from a book with syntax errors. "Just fix them" --- but how? They don't know the correct syntax. They're trying to learn, and being foiled! Furthermore, the "if it compiles, it's correct" sentiment is horribly wrong in the context of professional programming in general, and in the context of C++ in particular.
    – Cody Gray Mod
    Commented May 3, 2019 at 16:21

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