I’ve been doing a lot of iPhone development lately, and I have a naming issue for which I can’t think of a good solution. The problem is that somethimes I have to refer to “iOS” in variable, namespace, or class names. How should I do it? Suppose I have a version of “MyClass” that is designed for iOS. Should I call it:
iOSMyClass?
This is bad. Class names are supposed to start with a capital letter.
IOSMyClass?
This is bad. Now my class looks like an interface.
AppleMyClass?
This is better, but what if I create a version of the class for Macs?
AppleMobileMyClass?
This is better, but it’s starting to get pretty verbose.
Any thoughts? I’m developing desktop software using C#.
Suggest going with your second choice, but a slight mod:
IosMyClass. Consider the convention of 3 letter acronyms being Pascal cased (i.e. MVC in System.Web.Mvc). Of course, Apple flips that around in its implemention withiOS. However it sounds as if this is for the .NET space, and the desire is to follow its conventions.There are handfuls of other classes (in the .NET Framework even), that start with the letter
I. Admittedly, it’s not ideal, as it’s so close to the convention of prefixing interfaces withI. However, interfaces start with two upper case letters (I[A-Z]). That identifies them as an interface. SoIosMyClass, by convention, is not an interface, butIIosFoowould be.