kodecocodes / english-style-guide

Style guide for writing in English for tutorials and articles at Kodeco.
157 stars 22 forks source link

Pluralization of code objects #9

Open crispy8888 opened 9 years ago

crispy8888 commented 9 years ago

I don't think I've seen this covered elsewhere, but the question is straightforward:

Should we refer to multiple UIThing objects as:

UIThings ...or... UIThings?

The former is technically more correct but the latter looks and reads a lot better. Your thoughts, contributors?

greystar93 commented 9 years ago

@crispy8888 Chris LP and I independently decided awhile back during one of the books that it should be UIThings, and that's what I've done since then. But it does always stick out in copy and bug me.

Here's what Apple says:

Code font in text [...] Don’t mix fonts within a single word. Rewrite to avoid forming the plural of a word in code font. Correct: values of type integer Incorrect: integers

Of course, Apple says to do many things that we don't do, like put variables in text in italics. But this advice does seem sound to me. Though, probably it's a rare reader who cares if UIThings is technically incorrect.

Let's ask @gregheo, @wlinc and @rwenderlich what they think.

gregheo commented 9 years ago

I hate the look of UIThings. While it looks particularly horrible here on GitHub issues, it's not too bad on the site and books.

It's extra wordy, but I try to write "UIThing objects" or "Int values" or "NSWhatever instances" as appropriate. I'm not always consistent at editing these out but I do it sometimes.

Some authors like to name types a lot, which means you run into this plural thing a lot:

In your UIViewControllers it's important to have references to other UIViewControllers to then draw to their UIViews inside all of their frames.

Personally, I think too many shifts to code style is distracting. A UITableView is a "table view" and unless spelling out the exact class name is important, I'd rather write "table view".

In your UIViewController objects, it's important to have references to other view controllers to then draw to their views inside their frames.

ceo-nada commented 9 years ago

Agree with the sentiment that it looks odd, and I think it looks odd no matter the medium. Hence, I typically edit "pluralized" code out through strategic rewording for the sake of clarity, and so as not to assault the readers' eyes. (Or at least mine.)

I wish I knew when things are objects, values and instances, but I suppose I could make an educated guess and flag it with a TODO for the FPE. Would that be a process we could all agree upon?

Sent from my iPad

On Aug 21, 2015, at 5:48 PM, Greg Heo notifications@github.com wrote:

I hate the look of UIThings. While it looks particularly horrible here on GitHub issues, it's not too bad on the site and books.

It's extra wordy, but I try to write "UIThing objects" or "Int values" or "NSWhatever instances" as appropriate. I'm not always consistent at editing these out but I do it sometimes.

Some authors like to name types a lot, which means you run into this plural thing a lot:

In your UIViewControllers it's important to have references to other UIViewControllers to then draw to their UIViews inside all of their frames.

Personally, I think too many shifts to code style is distracting. A UITableView is a "table view" and unless the spelling out the exact class name is important, I'd rather write "table view".

In your UIViewController objects, it's important to have references to other view controllers to then draw to their views inside their frames.

— Reply to this email directly or view it on GitHub.

greystar93 commented 9 years ago

I could definitely agree with that process. If we're not sure how to rearrange, leave a TO-DO. We can also ask tech editors to keep an eye out for this.