0

I have read a number of books about computer programming, and never thought about this before. However, from one day to another, I started to notice that subprograms, functions, and other specific objects in computer programs, are often mentioned in a rather backward way.

Instead of writing

"A long list of objects can be sorted by calling the function QuickSort from the library DataManagement.",

authors often reverse the word order, like this:

"A long list of objects can be sorted by calling the QuickSort function in the DataManagement library."

To me, this is as jarring and illogical as writing "The ball was fetched by the Spot dog", or "The criminal was caught by the Peter policeman".

Is the "backwards" word-order formally OK? What have I misunderstood?

2
  • Far too many technical writers seem to think that using "passive" constructions makes their text look more "professional", whereas actually it often just makes things more difficult to parse, for no good reason. You should prefer the "active" form: The QuickSort function in the DataManagement library can sort a long list of objects - or if you specifically want to mention calling the function, [You can] Call the QuickSort function in the DataManagement library to sort a long list of objects. – FumbleFingers Feb 6 at 13:26
  • Sorry about the passive voice. – user4311624 Feb 7 at 19:35
2

This is very a common phenomenon in English. A native speaker would rather say a brick wall rather than a wall of bricks. The DataManagement library and the QuickSort function sound much more natural than the reverse word order. In writing, it has the advantage of brevity, and as long as it does not lead to ambiguity, this use is recommended.

It is the same with:

  • Academy Awards (not awards of the Academy)
  • A TV series (not a series of/on TV)
  • Data science Libraries
  • The sine function (mathematics)

For more on the use of attributive nouns in academic writing, see these editing tips.

5
  • If brevity is our goal, "QuickSort" and "DataManagement" would suffice. They are, after all, names for specific entities. Just as with my comment for James K's contribution, I must admit that I don't think the example "a brick wall" is quite the same as my examples. "Brick" in "a brick wall" refers to a material, just like wood, steel, etc. "QuickSort" in my example, however, was the name of one particular instance, just like "Spot" and "Peter" in my other examples. Doesn't that change anything? – user4311624 Feb 7 at 19:34
  • Would it be correct to say that constructs like "a brick wall" make "The QuickSort function" sound more natural to the native speaker, even though the same word order as in "the policeman Peter" would be more correct formally? (Languages are seldom 100 % consistent and logical, so I could totally buy such an "explanation".) – user4311624 Feb 7 at 19:40
  • @user4311624: In your examples, Peter and Spot are appositions, whereas "QuickSort" and "DataManagement" are not. They are attributive nouns of the kind you can find in the examples I gave. So your analogy does not stand. With appositions, you can say "Peter the policeman" or "the policeman Peter" (I prefer the first). – fev Feb 7 at 19:44
  • I don think that "constructs like "a brick wall" makes "The QuickSort function" sound more natural to the native speaker". It is just the way the language works. You ask if "the same word order as in "the policeman Peter" would be more correct formally" .Actually "the policeman Peter" is less common than "Peter the policeman". This structure may sound more correct to your non-native ear but it is not. "the QuickSort function" is perfectly correct. Not any less than the reverse word order, which although grammatically correct may sound less natural and heavy in certain contexts. – fev Feb 7 at 19:49
  • After doing some heavy reading about attributive nouns, I must say I disagree with respect to QuickSort and DataManagement being of that kind. They are the names of one particular function, and one particular library. That is, they are proper names, not attributes. – user4311624 Feb 17 at 17:36
0

There is no problem using the names of functions or libraries as attributive nouns.

Indeed this is the normal word order: the modifier precedes the noun. So saying "the quicksort function" is normal and correct.

It is also possible to say "the function, quicksort". Here the two nouns are in apposition (quicksort is a function and the name of the function is quicksort")

Which order is most natural in a given situation tends to be idiomatic. (Mississipi river, but river Thames)

2
  • I must admit I am not quite happy with your example, since "the quicksort function" uses "quicksort" in the meaning "any function using the quicksort algorithm". In terms of my original examples, this would be akin to saying "The ball was fetched by the quick dog", the word-order of which I have no problems at all. – user4311624 Feb 7 at 19:27
  • Now that I have figured out what an attributive noun is, I still find the examples in the answers somewhat missing the trouble I try to communicate. The function QuickSort in my example may be a quicksort function, it is merely good coding habits which have guided the author to name it QuickSort. What if it had been named AbrahamLincoln instead? Wouldn't it feel awkward with "The AbrahamLincoln function deals with..."? – user4311624 Feb 17 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.