Purpose
There is a philosophical issue with not separating meta-content from actual question content. I have seen people take issue with this, and FAQ posts typically try to minimize the meta-content by formatting it as <sub>
.
Where such content exists at all (there are still objections, but I assessed that the overall idea had sufficient support), the primary purpose should be to distinguish the questions, and add value as a directory. Linking duplicates is not directing people. Just like how two signs in the downtown core of a city, that point at each other and say "there is more of the city over there", are not useful.
This sort of directory helps people who find a close-but-not-quite question, and improves guidance for curators closing future questions. (Ideally, the related links will fit within the question preview in the closure dialog; the choice to use smaller text also helps with that, by the way).
There is no point in using a directory to point at questions that are deemed to be the same question, because actual duplicates should be centralized. The purpose of having canonicals is so that everyone only needs to read and contribute to one question, and all of the best information is in the same place.
Having a section like this also helps advertise a community consensus that the question is the canonical - this is not necessarily the oldest, nor the most viewed, nor the most upvoted, nor the highest-answer-count, nor even the highest-duplicate-count version of the question. In a perfect world, it would be all of those things, but none is guaranteed. Instead, a community of curators is liable to notice after the fact that there are many outstanding, well regarded, competing duplicates of fundamentally the same question, and work to choose a winner. Or they might have to start from scratch.
Implications
Anyone who has written a high-quality answer to something that was closed as a duplicate to what clearly appears to be set up as "canonical", should typically migrate their answer there, if it would not substantially duplicate an existing answer. It may also be worthwhile to comment on such answers to point out the situation, if the author is still active. Content from such answers might also be used, with appropriate attribution, to improve existing answers on the canonical.
A list like this should absolutely not be used to point out questions that curators think are actual duplicates. The saying is "all roads lead to Rome" for a reason, even though physical roads can be traveled in both directions. We have instantaneous, one-way teleporters; why on Earth would we do extra work to install them the wrong way around?
The duplicate relationship, when everyone is doing their job properly, is transitive, so links should be fixed to go directly to the canonical.
On the other hand, adding related links is adding value by pointing out relationships identified by subject matter experts, and clarifying the scope of individual questions. We cannot rely on the site's "Related" feature for this: it's not based on human insight and doesn't appear to give a damn about question quality. Similarly, "Linked" is a hodge-podge of actual duplicates mixed together with e.g. questions where someone mentioned the current question in passing in a comment - possibly in response to a help vampire.
This question in particular
Disclaimer: I stopped using C or C++ for any serious purpose right around the time C++11 was released; although I still consider myself competent with them, I am not properly familiar with many newer features, and my language-lawyerly knowledge may have faded.
Perusing the duplicate and "related" links that were contained in the answer, I found that most of them really are just duplicate. A big part of the problem is that this question needs editing for scope and clarity. While there seems to be strong consensus that it currently offers the best answers, it doesn't frame the question well. Although I generally dislike this kind of bullet-point list (even for intentional "FAQ" entries), I find that What is the proper declaration of main in C++? is a better framing of the question. (That is not a reason to make it the canonical instead!)
The issues I see with the phrasing are:
The title explicitly asks about the return type, but the parameters are clearly a much more interesting aspect of the question. I have to scroll very far before I see an answer that isn't discussing the entire signature of main
. This happened in part because the question text asks about a "way to define" the function (but then gives example signatures rather than definitions), but mostly because the parameters and return type are two sides of the same coin and there is no good reason to ask about them separately. Especially since the relevant Standard text describes them both in the same place, by way of showing valid signatures.
So, the question should be phrased and titled in that form. It would be okay for the title to include the word "return" somewhere, since that helps with search; but it should definitely include the other stuff, because that helps search (and curators!) even more.
"The correct (most efficient) way" makes little sense. Efficiency is of course a total canard here. There is more than one "correct" way, in the sense that the set of possibly-ever-valid signatures has more than one element. Instead, the question is really about:
- What signatures are permissible according to the Standard?
- What are the semantics of the return type and arguments?
- What happens if an invalid signature is used?
And all of that does make sense to include in the same question. Of course, answers need to make all appropriate distinctions between C and C++, and between versions of each.
Then there's the matter of what questions are related. Doing things my way, canonical versions of these questions would be identified and included in a short "See Also" section. I can extract the following potential, actually separate questions from what was linked:
What is the meaning of the names argc
and argv
? Are those exact names required? (It's useful to explain conventions; while the fact that they are conventional might naturally drop out of an explanation of what the Standard says about the signatures, it's still fundamentally a different issue - just as much as the conventional status of self
in Python is.)
Can the auto
keyword be used to infer the type of main
? (While this seems to have been answered, where it was asked, with the same Standard citation, that citation isn't necessary to answer the main question; therefore that isn't an argument for it falling under the same scope.)
And one other question that, to me, naturally arises from discussion I saw in those questions:
- May
main
recurse (or otherwise be explicitly called by the program logic)? If so, what are the implications for its signature?