As a non native english speaker I have a recurring problem with this: > getInstances(); // ok, returns an array of instances > getInstanceId(); // ok, returns an id > getInstancesId(); // ??, returns an array of id > get InstancesIds(); // ?? returns an array of id > getIdsOfInstances(); // ?? returns an array of id > getAllInstancesId(); // ?? returns an array of id > getAllInstancesIds(); // ?? returns an array of…
How Developers Choose Names
91–100 of 157 posts
Re: How Developers Choose Names
#92As a non native english speaker I have a recurring problem with this: > getInstances(); // ok, returns an array of instances > getInstanceId(); // ok, returns an id > getInstancesId(); // ??, returns an array of id > get InstancesIds(); // ?? returns an array of id > getIdsOfInstances(); // ?? returns an array of id > getAllInstancesId(); // ?? returns an array of id > getAllInstancesIds(); // ?? returns an array of…
As a native English speaker (and former English teacher), hope this helps: > getInstances(); // ok, returns an array of instances Correct. > getInstanceId(); // ok, returns an id Correct. > getInstancesId(); // ??, returns an array of id Unusual, but would return a single ID referring to a collection of instances. > get InstancesIds(); // ?? returns an array of id Correct. Though more common would be getInstanceIds()…
Completely agree with all your points (as a native English speaker who also minored in English)
However, for the sake of clarity (since we're trying to disambiguate between places the 's' could indicated possession vs. plurality) "instance IDs" should not have an apostrophe.
The only time an apostrophe goes in a non-possessive plural is in a contraction. E.g. "the '90s"
Then we also have fun words that probably should never be used which get an apostrophe on both ends (contraction at beginning + possessive plural)
e.g. " ... the '60s' countercultural attitudes ..."
But for clarity it might be better to go with
"... the countercultural attitudes of the '60s ..."
Re: How Developers Choose Names
#93Re: How Developers Choose Names
#94Earlier quoted context omitted.
As a native English speaker (and former English teacher), hope this helps: > getInstances(); // ok, returns an array of instances Correct. > getInstanceId(); // ok, returns an id Correct. > getInstancesId(); // ??, returns an array of id Unusual, but would return a single ID referring to a collection of instances. > get InstancesIds(); // ?? returns an array of id Correct. Though more common would be getInstanceIds()…
> Though more common would be getInstanceIds() since you don't need to pluralize twice. E.g. we don't say "blues shoes", we say "blue shoes", so these aren't "instances ID's" but "instance ID's". Completely agree with all your points (as a native English speaker who also minored in English) However, for the sake of clarity (since we're trying to disambiguate between places the 's' could indicated possession vs. plura…
Some style guides insist plural all-capital abbreviations should never have an apostrophe ("IDs"), other insist they should ("ID's").
Your personal usage is absolutely valid, but it should be recognized as opinion and not fact. "ID's" is equally valid in modern usage.
Edit: You can read an extensive discussion of it here:
https://en.wikipedia.org/wiki/Acronym#Representing_plurals_a...
Re: How Developers Choose Names
#95Earlier quoted context omitted.
> Though more common would be getInstanceIds() since you don't need to pluralize twice. E.g. we don't say "blues shoes", we say "blue shoes", so these aren't "instances ID's" but "instance ID's". Completely agree with all your points (as a native English speaker who also minored in English) However, for the sake of clarity (since we're trying to disambiguate between places the 's' could indicated possession vs. plura…
That's a hotly debated issue that different style guides give different answers to. Some style guides insist plural all-capital abbreviations should never have an apostrophe ("IDs"), other insist they should ("ID's"). Your personal usage is absolutely valid, but it should be recognized as opinion and not fact. "ID's" is equally valid in modern usage. Edit: You can read an extensive discussion of it here: https://en.w…
I've seen it for one-letter words where you don't want to switch case: e.g. "dot your i's and cross your t's"
But I haven't seen it in upper-cased abbreviations followed by a lower case plural 's'. Or if I have, I've assumed it's wrong. Would love it if you can refer me to a modern style guide which doesn't recommend dropping the `'` in this usage, as my own background has drilled into me that "IDs" is preferred for clarity.
Re: How Developers Choose Names
#96With naming what IMO matters more than choosing one name, is choosing a name that is consistent with other similar names in the codebase. A new developer will learn your project's specific convention in a few minutes, but will be completely lost if the convention is routinely violated here and there. This is especially important with what verbs to use in methods, and how to name interfaces/classes in a way that respe…
Naming gets far worse than that. I've worked on code where the naming was not just unhelpful, it was outright misleading. One of the worst I remember was a project which unsurprisingly was named after a game of thrones character. As I never watched game of thrones it took me about two weeks before I could even remember the stupid name, during which time I was also dumbfounded as to how the program worked until I real…
It's one way to achieve job security for life though: https://github.com/Droogans/unmaintainable-code
Re: How Developers Choose Names
#97Earlier quoted context omitted.
That's a hotly debated issue that different style guides give different answers to. Some style guides insist plural all-capital abbreviations should never have an apostrophe ("IDs"), other insist they should ("ID's"). Your personal usage is absolutely valid, but it should be recognized as opinion and not fact. "ID's" is equally valid in modern usage. Edit: You can read an extensive discussion of it here: https://en.w…
Interesting. I've seen the apostrophe for acronyms which involve periods: e.g. "C.D.'s" (NYT has an article about this being their preferred style) I've seen it for one-letter words where you don't want to switch case: e.g. "dot your i's and cross your t's" But I haven't seen it in upper-cased abbreviations followed by a lower case plural 's'. Or if I have, I've assumed it's wrong. Would love it if you can refer me t…
> ...whereas The New York Times Manual of Style and Usage requires an apostrophe when pluralizing all abbreviations regardless of periods (preferring "PC's, TV's and VCR's").
Re: How Developers Choose Names
#98With naming what IMO matters more than choosing one name, is choosing a name that is consistent with other similar names in the codebase. A new developer will learn your project's specific convention in a few minutes, but will be completely lost if the convention is routinely violated here and there. This is especially important with what verbs to use in methods, and how to name interfaces/classes in a way that respe…
Naming gets far worse than that. I've worked on code where the naming was not just unhelpful, it was outright misleading. One of the worst I remember was a project which unsurprisingly was named after a game of thrones character. As I never watched game of thrones it took me about two weeks before I could even remember the stupid name, during which time I was also dumbfounded as to how the program worked until I real…
Re: How Developers Choose Names
#99Re: How Developers Choose Names
#100With naming what IMO matters more than choosing one name, is choosing a name that is consistent with other similar names in the codebase. A new developer will learn your project's specific convention in a few minutes, but will be completely lost if the convention is routinely violated here and there. This is especially important with what verbs to use in methods, and how to name interfaces/classes in a way that respe…
Naming gets far worse than that. I've worked on code where the naming was not just unhelpful, it was outright misleading. One of the worst I remember was a project which unsurprisingly was named after a game of thrones character. As I never watched game of thrones it took me about two weeks before I could even remember the stupid name, during which time I was also dumbfounded as to how the program worked until I real…
Hey, think yourself lucky. It's only a pretty recent occurrence that my team has more than just the two "Prod" and "Non-Prod" environments...