-3

It can be really annoying when a post gets bloated with unnecessary formatting and I certainly want to avoid this.

However, I'm not sure about the practice when it comes to framework names or various other technologies (CallKit, ContactsUI etc.)

Should I stylize them as CallKit and ContactsUI? Does it even matter?

5
  • 5
    Is "CallKit" code? Is "ContactsUI" code?
    – Servy
    Commented Dec 11, 2017 at 16:42
  • 8
    You should use code-blocks to format code. Company names, technology names, specific libraries names... are not code.
    – yivi
    Commented Dec 11, 2017 at 16:45
  • You could bold them if you really want them to stand out: CallKit
    – Davy M
    Commented Dec 11, 2017 at 17:02
  • 12
    And then again, maybe you should not. Bold them when required, but not as a general rule. @DavyM, text with a lot of random styles is quite annoying.
    – yivi
    Commented Dec 11, 2017 at 17:06
  • 3
    Code blocks? Surely you meant back-ticks. Please, please, no. Commented Dec 11, 2017 at 18:02

2 Answers 2

24

Well, do you format the names of people, places and other things as code?

If not, you wouldn't do it with these either.

(And if anyone out there reading this does, stop.)

These are proper nouns. Proper nouns are not code.

When in doubt, refer to the vendor documentation. Notice that while Apple's documentation diligently formats all class and method names as code, it makes an equal effort not to format the names CallKit or ContactsUI as code.

12

According to the answers to this question, code formatting should only be used for code. The obvious cases where code formatting is appropriate are parts of actual code, such as variables or functions. Code formatting can also be used for command line commands or file names.

Cases where it's not appropriate are random keywords in the text, such as programming language names, framework names or operative system names. Here is an example of what you shouldn't do (taken from here):

I am having a difficult time with a background task in iOS. The problem I seem to be facing is that iOS is silently terminating the App if my background task runs for too long. What can I do to increase time iOS will wait for my background task to complete?

The rule I usually set myself about the use of code formatting is to format things as code only if you're referring to something that a computer can understand (your compiler or interpreter understands variable names and function names, Windows Explorer understands file paths, cmd.exe understands command line commands, etc). If you write C++ in your code or in the command line, your computer won't understand it, so you shouldn't use code formatting for it (unless you have a variable named C that you want to increment, but that's something completely different).

It can happen that names of libraries, frameworks or programming languages are valid code. For example, you can run Python in cmd.exe by typing python. In cases like this, you should only format it as code when you're referring to the actual code, not to the name (for example "What happens if I type python in the command line?" is OK, but "I'm learning Python and need some help" isn't).

Not the answer you're looking for? Browse other questions tagged .