4

I am working on a new project that involves government funding. As such we will have objects (classes, properties, methods) that reference government legislation which have names like Title II, Title IV-A, Title IX, Title XVI, etc.

We are following the Microsoft guidelines for names but Pascal/camel casing for those does not read nicely to my eyes at this point. With Pascal casing, I get classes named TitleIi, TitleIva, TitleIx TitleXvi. Camel casing gives me variables with titleIi, titleIva, titleIx, titleXvi.

Another option would be to use arabic numbers instead of the Roman numerals. That gives me Title2, Title4 which reads better but gives the impression that we have multiple instances of something (for example, AddressLine1 and AddressLine2).

I'm looking for suggestions on this.

kapa
  • 77,694
  • 21
  • 158
  • 175
jovball
  • 126
  • 1
  • 6

3 Answers3

2

I suggest you do what is most readable in your code base. If camel casing is causing legibility issues, then don't follow that guideline in this instance.

They are only guidelines, not rules.

Adam Houldsworth
  • 63,413
  • 11
  • 150
  • 187
2

At the end of the day naming conventions are just that - "conventions".

In your example I would use title_IV_A or Title_IV_A - you'll be saving yourself a headache and making life easier on yourself.

Barry Kaye
  • 7,682
  • 6
  • 42
  • 64
0

I'd just ignore the guidelines and name the classes TitleII, TitleIV_A etc. (note that you may need to replace the "-" by "_").

Thorsten Dittmar
  • 55,956
  • 8
  • 91
  • 139