How to camel-case where consecutive words have numbers?
Posted
by
Rob I
on Programmers
See other posts from Programmers
or by Rob I
Published on 2012-03-20T18:11:51Z
Indexed on
2012/03/20
23:39 UTC
Read the original article
Hit count: 256
naming
|code-style
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.
© Programmers or respective owner