Is "I >am having< a code which ... " acceptable?



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?


Posted 2013-01-29T22:48:10.310

Reputation: 4 059

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 – 2014-08-27T11:54:01.180

In what context do you hear this? – Squazic – 2013-01-29T22:51:10.220

@Squazic Forms like this appear quite frequently on Stack Overflow.

– ctype.h – 2013-01-29T22:54:29.940

1As in, can you give some more context like examples and such? – Squazic – 2013-01-29T23:06:44.230

1Personally I would write "I have this piece (bit) of code" or "I have this code". – Barranka – 2013-01-29T23:34:10.707

3I'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 – 2013-01-30T01:11:19.167

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 – 2013-01-30T14:47:18.980

@ctype.h Search for the whole phrase; you're right, it is shockingly common.

– Ken Bellows – 2013-01-30T15:24:52.023



"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

Posted 2013-01-29T22:48:10.310

Reputation: 2 697

I think "a code" is sometimes used by people who have difficulty with uncountable nouns, such as native speakers of Japanese. – Andrew Grimm – 2013-01-30T02:53:48.083

5"I'm having a code" is what a computer virus might say... nom nom nom... – SF. – 2013-01-30T08:05:04.970