12

On StackOverflow I often see this:

I’m having a code which (does such and such, followed by a fragment of code)

Is I am having a code grammatically correct? I think it is incorrect, and that it should be, I have some code, but I continue to see it more and more frequently.

Is it grammatically correct, or is it a common error? If it is correct, why?

StoneyB on hiatus
  • 175,127
  • 14
  • 260
  • 461
ctype.h
  • 4,043
  • 1
  • 26
  • 44
  • In what context do you hear this? – Squazic Jan 29 '13 at 22:51
  • @Squazic Forms like this appear quite frequently on Stack Overflow. – ctype.h Jan 29 '13 at 22:54
  • 1
    As in, can you give some more context like examples and such? – Squazic Jan 29 '13 at 23:06
  • 1
    Personally I would write "I have this piece (bit) of code" or "I have this code". – Barranka Jan 29 '13 at 23:34
  • 3
    I've taken the liberty of incorporating an SO example into your question - something concrete like this provides context which will avoid confusion. Also, it's conventional in discussion of language to italicize examples being discussed rather than to enclose them in quotes; certainly you don't need both. – StoneyB on hiatus Jan 30 '13 at 01:11
  • This is two questions, though you may not realize it. The first is the proper use of "I am having a NNN", the present progressive of have. The second is which determiner is the correct one to use with the noun code. – Mark Beadles Jan 30 '13 at 14:47
  • @ctype.h Search for the whole phrase; you're right, it is shockingly common. – Ken Bellows Jan 30 '13 at 15:24
  • It is fine to say "I'm having a code" in the sense of "I am having a swim", i.e. enjoying an activity (in this case coding), but the example you give is not that usage and appears wrong. – Francis Davey Aug 27 '14 at 11:54

1 Answers1

13

"I am having a code" doesn't make sense, whereas "I have some code" does make sense.

"A code" might be used for, say, an identification code, which is unique, but "code" as used here more likely means "a piece of code" like a script, or a coherent block of computer instructions.

"Am having" implies that something is taking place over a span of (present) time, while "have" implies possession; possession is the more likely meaning here. "I am having a problem with this code" expresses a logical situation where the "am having" construction makes sense.

barbara beeton
  • 2,807
  • 22
  • 29
  • I think "a code" is sometimes used by people who have difficulty with uncountable nouns, such as native speakers of Japanese. – Golden Cuy Jan 30 '13 at 02:53
  • 5
    "I'm having a code" is what a computer virus might say... nom nom nom... – SF. Jan 30 '13 at 08:05