Just wondering if anybody has a good convention to follow in this corner-corner-corner case. I really use Java but figured the C# folks might have some good insight too.

Say I am trying to name a class where two consecutive words in the class name are numeric (note that the same question could asked about identifier names). Can't get a great example, but think of something like "IEEE 802 16 bit value".

Combining consecutive acronyms is doable if you accept classnames such as HttpUrlConnection. But it seriously makes me throw up a little to think of naming the class IEEE80216BitValue. If I had to pick, I'd say that's even worse than IEEE802_16BitValue which looks like a bad mistake. For small numbers, I'd consider IEEE802SixteenBitValue but that doesn't scale that well.

Anyone out there have a convention? Seems like Microsoft's naming guidelines are the only ones that describe acronym naming in enough detail to get the job done, but nobody has addressed numbers in classnames.

  • 1
    Probably not on topic on SO, still an interesting question. Mar 20, 2012 at 18:13
  • 4
    I'd probably go with _ if necessary. Everything else I can think of (except reordering where possible) is even worse. In your example Ieee802Value16Bit is what I'd do in your example. Mar 20, 2012 at 18:14
  • Oops. I figured with the existence of a naming-conventions tag, it was close enough to on-topic to at least ask. :)
    – Rob I
    Mar 20, 2012 at 18:14
  • Simple: do not use camel case. Today there is no reason for it because linkers are not restricted to 6 characters in external names. I eschew embedded capital letters in names; to my prose-oriented eyes, they are too awkward to read comfortably. They jangle like bad typography. - Rob Pike, "Notes on Programming in C"
    – Kaz
    Mar 20, 2012 at 18:15
  • 4
    @Kaz We're talking about C#/Java here. Also beauty is in the eye of the beholder. Personally I think _ is uglier than camelCase or PascalCase. Mar 20, 2012 at 18:16

3 Answers 3


I'd figure out a new variable name instead of trying to figure out what naming convention to use for a double-number variable

That said, if I absolutely HAD to use a double-number in my variable name, and I couldn't rearrange the words/numbers to come up with something reasonable, and absolutely no other name would make sense, I would use an _ between the numbers


Actually I take it back, I would just figure out a new variable name :)

  • 9
    +1 We make network equipment at work, so one would think standard-related class names come up a lot, but I don't remember having this issue, so I looked through our code base. Instead of prefixes like IEEE802, we use esoteric words like "Ethernet" :-) Mar 20, 2012 at 19:26
  • 2
    What about SHA-512/256 or SHA3-256? I'm having a hard time coming up with names that don't contain an _. Dec 6, 2013 at 14:16

I'd personally go for the underscore route e.g. IEEE_802_16_BitValue. Currently dealing with modelling some CPU architectures, this Q was good timing :-)


I have used some letter to delimit consecutive numbers. For me it would be Ieee802x16bit (not IEEE802x16bit). I think it is less distracting then a lone underbar in the middle of a jungle of letters and digits.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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