I am reading a sentence:

Also, a tuple is always an ad-hoc structure: It’s difficult to ensure that two tuples have the same number of fields and the same properties stored on them.

ad-hoc's explanation in Oxford Dictionaries
Created or done for a particular purpose as necessary.
Origin: Latin, literally ‘to this’.

So the sentence could be rewritten as:

a tuple is always such a structure: ...

I have strong intention to write professional english or at least look like that way.

Is it fancier to use 'ad hoc' instead of this or such ?

  • 1
    Use ad hoc without the hyphen, set off in italics if possible, and you'll be fine. If the rest of your sentence is grammatical, it will go some way toward making you sound like an educated professional.
    – Robusto
    Dec 5 '17 at 15:46

Ad hoc in English is not a synonym of "this" or "such", so you'd be changing the meaning of the sentence if you used "such" and "ad hoc" interchangeably.

Look at the definition you quoted: "Created or done for a particular purpose as necessary." If you wanted to rewrite this sentence without using the Latin phrase, but still preserving its meaning, you'd write something like:

...a tuple is always a custom-built structure...

So, while using ad hoc is good professional English, make sure you're using it in its proper sense of "built as necessary for a particular purpose," not as a replacement for "such a [thing]."

As @eques comments below, ad hoc has a slightly different connotation than custom-built. Ad hoc implies that the thing is built on-the-fly without much careful planning, while custom-built could mean something that is very deliberately planned and carefully designed. Sometimes ad hoc can even have a negative meaning (as something that's slapped together quickly as a temporary solution, but is probably badly designed and should be replaced), but that isn't the case in this particular example.

Here's an example of ad hoc in the more negative sense:

We cut a hole in the wall and put a fan in it as an ad hoc cooling system for the server room, but eventually management will have to replace the air conditioning unit with a more powerful one.

  • "custom-built" this doesn't seem like it fits based on the context and meaning of the "tuple".
    – eques
    Dec 5 '17 at 16:08
  • Why not? A "tuple" is a sequence in the programming language Python that contains an arbitrary number of arbitrary immutable elements. That is, each individual tuple is custom-built by the programmer for whatever purpose the programmer needs to accomplish in that moment. That's what ad hoc means in English. Dec 5 '17 at 16:15
  • 1
    "custom-built" and ad-hoc do not have identical connotations. It's a close-fit, but it doesn't quite fit right. If I were trying to avoid "ad-hoc" for a programming concept, I wouldn't default to "custom-built". "Ad-hoc" in a programming sense often not only being not from a pre-existing pattern, but also that it's constructed "on the fly". A tuple is "ad-hoc" because it's created as needed; a custom class is not "ad-hoc" necessarily but still "custom-built"
    – eques
    Dec 5 '17 at 16:24
  • @eques, that's probably why the original writer used ad hoc rather than custom-built. There may not be any one or two-word replacement that captures the meaning exactly. The main point is that "such a" changes the meaning completely.
    – The Photon
    Dec 5 '17 at 16:34
  • @eques - I agree with your "on-the-fly" note. Sometimes ad hoc has a negative connotation as shoddy or hastily built, but that's not the case in this particular example. I'll edit my answer with this additional information. Dec 5 '17 at 16:40

The two sentences are both grammatical but don't mean the same thing.

a tuple is always such a structure:...

This means that the tuple is a structure with characteristics that we've just been discussing or that we're about to discuss. The part after the colon can then be the description that "such a" is referring to.

a tuple is always an ad hoc structure:...

This means that a tuple is designed in the moment to solve an immediate problem. It's implied that it doesn't have some benefits that a carefully designed solution could have.

In this case the part after the colon provides some explanations of the disadvantages from using this ad hoc solution. It isn't meant to and does not restate the meaning of the term ad hoc.


I believe the distinction your text may be making about a tuple with ad hoc is that the tuple is either a "scratch" or ephemeral copy of a row from a persistent table, or a row instantiated as-needed without the underpinnings of a persistent table. There being no tightly coupled table object to enforce sameness with respect to the number of columns or sameness of datatype of the column(s), comparing two tuples one against the other can be problematic. Enforcement of sameness in respect to number and datatype requires metadata stored in a table definition. A tuple has no such "baggage" to explain itself.


Ad hoc is better understood as only applying to this in its English usage. If you create an ad hoc report, for example, you are creating a "one-off" report, a report that you are only going to use in the particular circumstance in which you create it.

What your sentence is saying is that, since the number of members of a tuple is unknown as part of its definition, any structure conforming to it must evaluate the contents of the tuple at the time of its creation. That means that it has to be created for that tuple only.

You must log in to answer this question.

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