2

For example: Meta-information

metaInfornation, metainformation or metainfo?

getMetainfo, getMetaInfo or getMetaInformation?

what about objective-c style?

BergP
  • 3,453
  • 4
  • 33
  • 58

2 Answers2

4

I am personally a fan of camelCase and no abbreviations. So I would use metaInformation. metaInfo is also good because it's a very common abbreviation.
What I dislike is something like printAttr or similar.

Apple has docs on that topic describing the conventions.

Note that you should not use get in your getter!

When you apply these conventions you have many opportunities (e.g. Key-Value-Coding).

HAS
  • 19,140
  • 6
  • 31
  • 53
2

If it's a property, then you'd want to use metaInformation or metaInfo, and it will generate the getter as -metaInformation or -metaInfo. Never use get in a method name.

max_
  • 24,076
  • 39
  • 122
  • 211
  • 1
    Uppercase `I` is the one to choose ;) – HAS Apr 22 '13 at 07:03
  • @max_ From the [docs](https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CodingGuidelines/Articles/NamingMethods.html): `If the method returns an attribute of the receiver, name the method after the attribute. The use of “get” is unnecessary, unless one or more values are returned indirectly.` – HAS Apr 22 '13 at 07:04
  • Yes, everything is clear about "get" in obj-c :), I gave generalized example, thanks! I was more interested in choice of upper or lower case next to dash. – BergP Apr 22 '13 at 07:10