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?

  • 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 1:11

"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.

  • I think "a code" is sometimes used by people who have difficulty with uncountable nouns, such as native speakers of Japanese. – Andrew Grimm Jan 30 '13 at 2:53
  • 5
    "I'm having a code" is what a computer virus might say... nom nom nom... – SF. Jan 30 '13 at 8:05

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.