Skip to content

Objective-C types should have a three letter prefix e.g. OCV #18843

@chrisballinger

Description

@chrisballinger

From Apple's documentation on this topic:

Your own classes should use three letter prefixes. These might relate to a combination of your company name and your app name, or even a specific component within your app. As an example, if your company were called Whispering Oak, and you were developing a game called Zebra Surprise, you might choose WZS or WOZ as your class prefix.

https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/Conventions/Conventions.html#//apple_ref/doc/uid/TP40011210-CH10-SW2

The reason for this is that Objective-C has a global namespace, and type names can conflict. Some of the types bundled with the objc module are very simple and prone to conflict like Mat, and Range.

Here is another article on the topic:

I propose using the OCV prefix, and namespacing all of the existing types in the objc module. e.g.

  • Range -> OCVRange
  • Mat -> OCVMat

This would be a breaking change, but is necessary to prevent future conflicts with private Apple types, or with other application types.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions