Possible Duplicate:
Marking plural of code words
Pluralizing Keywords in Programming Languages
After asking a number of questions on StackOverflow, I keep running into some of the same phrasing issues. Typically these issues stem from variable names.
How do I correctly pluralize or possessivize* a word or phrase in quotes or code blocks?
Are there any differences in grammatical structure if <code>
blocks, or `
characters are used to delineate quoted words, phrases, or variables instead?
* I don't know the right word for "possessivize" either; anyone who would like to correct it can be my guest
As a simple example that involves some basic JavaScript code:
var chars, char;
chars = 'abcdefghijklmnopqrstuvwxyz'.split('');
chars.forEach(function (char, index, chars) {
console.log(index, char, char.length);
});
console.log(char);
Possessive
within the callback,
char
'slength
should always be1
.
-or-
within the callback, "char"'slength
should always be1
.
Plural
char
s are defined in multiple scopes
-or-
"char"s are defined in multiple scopes
I'm aware that these aren't the best of examples, as I would typically write "char
instances" instead of "char
s", but I couldn't come up with a better example at the moment. The general idea still stands.