56

At the moment, there are tags for many members of the printf-family of library functions, though not for all (, , , , , , ).

I propose merging and synonymising them all to , because:

  1. Often at least one other member of the family is used in the question.
  2. Sometimes only another member of the family is actually used in the question.
  3. Even if both 1 and 2 do not apply, the answers are at least likely to recommend another member of the family.
  4. Just about every explanation / use of one member of that family applies to them all with at most slight variation, so the exact one mentioned is quite arbitrary.
  5. Another point which supports 4, they are all handled together or at least in as big a group as makes sense for the format in common documentation like the C / C++ / POSIX standards, man and info-pages. (thanks @anthony-arnold)
  6. Merging alone is not enough, because someone would inadvertently recreate them for sure.

This post is mainly here to get those who can endorse my proposal to notice the pending synonyms.

Direct link to the synonyms, where they can be upvoted or downvoted, depending on your approval or disapproval of my proposal, assuming you have sufficient answer score in the tag.

9
  • What about using a more generic tag, like "output" ? Commented Apr 18, 2014 at 14:38
  • 19
    @NickL.:"output" would be too generic: Besides it not implying formtting, especially using a formatting string, printf is already an institution copied to other languages. Anyway, there are many other domain-specific-languages for formatted output. Commented Apr 18, 2014 at 14:42
  • 1
    "formatted-print" could be another idea. The difference with "printf" tag is that printf is directly associated with C only, in a sense. Commented Apr 18, 2014 at 15:15
  • 7
    @NickL.: It might have originated there (AFAICT it did), but it was imported wholly into PHP and others, so is no longer restricted to C++ and C (not that that is important here). formatted-print does neither convey the specific DSL used, nor is it recognized as the appropriate tag for using format strings, nor is it a tag at all atm. Commented Apr 18, 2014 at 15:23
  • 2
    @NickL. Also, most Unixes now have a "printf" command, so it can be used in shell scripts, too. Commented Apr 18, 2014 at 20:13
  • 1
    I'm not sure whether it actually makes a difference to anyone, but I typically don't accept an answer until the request is completed (unless you figured it would be marked status-completed, although these don't get often marked as such). Commented Apr 19, 2014 at 3:18
  • Grouping all of these tags together would be in line with convention. Most man pages/documentation groups all of these functions together.
    – Anthony
    Commented Apr 19, 2014 at 5:46
  • @Dukeling: Thanks, that's actually a good reason not to mark anything as accepted yet. I just haven't done that much on meta yet. Commented Apr 19, 2014 at 9:44
  • [varargs] would be the more generic tag. But it is a meta-tag and adds very little. Most any C or C++ user would know how to answer such a question. So no point in changing them either. Commented Apr 20, 2014 at 11:16

2 Answers 2

48

Even if there might be a more general term that would include all the printf types, unless we clearly agree on one, I do still believe that merging all the printf variants into just is the right step.

, , , , , are all the same printf function except that they have the output go somewhere else or accept a different kind of input. It’s like function overloading in other languages. So even if there are differences, they are somewhat minor as the main purpose of printf is to take some variable arguments and construct a formatted string from them according to a format string which all those function share.

So yes, I would support synonymizing those tags into for now. If we later find a more general term, then we can always change it again.

6

I'm personally against a blind synonymization in this case.

Don't get me wrong - I'm not saying synonymization is a bad idea, I just don't think we should do so without looking at most / all questions with these tags.

If there's even a remote possibility of someone asking a question which is specific to one / some of the functions, but not the rest (which I definitely think there is), we shouldn't synonymize them without first trying to identify these or establish, with sufficient certainty, that such questions don't exist, or are rare enough that a tag dedicated to them is not particularly useful.

If can't identify sufficient questions to justify different tags (after looking through the questions), we could synonymize them.

If we do identify questions to justify different tags, we might keep as the master tag (based on my knowledge of C and C++, the chances of a question unique to printf seems particularly rare) or perhaps a or .

If some of the tags are justified, but not all, we should perhaps consider just merging the others into (not synonymizing them), allowing the creation of these tag were questions to pop up where the tag is justified.

5
  • 3
    I'm with you on this. Though they all share the printf base functionality, the n and v versions often have questions asked about those particular features of the functions. Consider this question. The fact that va_start and va_end are necessary to the vsprintf call is an imperative point of the answers -- and anyone searching for a vsprintf answer will necessarily need to know that. I say, leave them separate, but let any of them imply printf.
    – bishop
    Commented Apr 19, 2014 at 13:58
  • 2
    @bishop: Actually, that is a bad question using bad tags trying to make something work despite abysmal decisions, which are not adressed. Imho. Correct me if I'm wrong about any of those particulars. Commented Apr 19, 2014 at 17:31
  • 1
    @Deduplicator I agree that that's a bad question, since it basically says "my code doesn't work", but doesn't show any code. Although I think the basic idea is there - a question specifically pertaining to va_list definitely isn't applicable to the entire printf family of functions - perhaps tagging such a question with va-list instead would be more appropriate then, but, either way, that supports the point in my answer - we need to look at individual questions, not blindly synonymize them. Commented Apr 19, 2014 at 20:51
  • 2
    @Dukeling: Adding more appropriate tags is always a nice idea, but the vsprintf-tag does not add any value there over printf imnsho. Still, it's always debatable when a minor quirk becomes a major change. Commented Apr 19, 2014 at 21:21
  • I'm with you, there are a lot of times for my Systems Programming class where I had to search up specific variations of printf because we almost never use printf, instead we use fprintf (for debugging), sprintf, and etc. To me, a closely-related example would be if we wanted to synchronize all the family of exec, which I think is a NO NO.
    – ygongdev
    Commented Jun 17, 2016 at 21:40

You must log in to answer this question.

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