12

When should we use "object-oriented" and when "object oriented" when talking about programming?

An example:

Why should I start writing object oriented code?

I personally think that there should be a hyphen, because "oriented" connects to the word "object", but I am not sure.

14

The Chicago Manual of Style notes:

With the exception of proper nouns (such as United States) and compounds formed by an adverb ending in ly plus an adjective, it is never incorrect to hyphenate adjectival compounds [of which object-oriented is one] before a noun. When such compounds follow the noun they modify, hyphenation is usually unnecessary, even for adjectival compounds that are hyphenated in Webster’s (such as well-read or ill-humored).

So:

Smalltalk is said to be a pure object-oriented language.

But:

These characteristics make a programming language object oriented.

  • 3
    (This is the correct answer). Hyphenate compound adjectives when used attributively and don't hyphenate when used predicatively. – nohat Feb 6 '14 at 3:02
  • 1
    The rule extends to other compound attributive pre-modifiers (eg sweet-shop girl). – Edwin Ashworth Mar 2 '17 at 11:19
  • @nohat and Gnawme: Could you please add a remark to the hyphenation of compound adjectives that precede another adjective or a verb? E.g, "Object-oriented programming language" and "topic-oriented directed search". Can it be dropped or better retained? Which is more grammatically sound? – Ébe Isaac Oct 15 '18 at 6:58
3

They're equivalent, as it's valid to have an open compound adjective (one with a space rather than a hyphen), and both form mean the same thing.

However:

  1. It can be clearer to use a hyphen.
  2. The hyphenated form would seem to be much more commonly used even considering the fallibility of ngrams.

So, it might be wise to use the hyphenated form.

1

When two (or more words) are to act as a single attributive adjective, you hyphenate them.

So, you must ask yourself "what type of code do I write?" - "I write object-oriented code."

Here object-oriented is a single unit that describes (adjectivally) code.

If these two words are simply part of the clause, ie, a predicative adjective, they don't need hyphenating. Think of it this way. "what is this software like?" - "This software is object oriented." In other words, "This software is oriented in an object way!"

I have found that many folk hyphenate in the latter case as well, but it's more important (for clarity's sake) to ensure you hyphenate in the former case.

  • 1
    I am still confused when not to use a hyphen. I am starting to think that the only correct form is "object-oriented". Could you elaborate on that? – kalekip1 Feb 5 '14 at 18:40
  • I think you need to check on the attributive and predicative positions for adjectives. Here, 'object(-)oriented' is 'acting as a single adjective' (an open compound or a hyphenated compound) in both of your examples. Gnawme's answer is more accurate (though I'm sure this has been addressed here before). – Edwin Ashworth Feb 5 '14 at 22:27
0

Hyphenate compound adjectives for clarity of communication.

0

Whichever you choose, you should be consistent within the work that you're creating.

If you're writing an email, then all instances within that email should be the same (hyphenated or not)—the same goes for a book, or for technical documentation.

As to which to pick, I defer to the other answers.

  • 3
    Consistency isn't always the right approach. Words behave differently in different contexts. – Bradd Szonye Feb 5 '14 at 22:16

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.