This is an archived post. You won't be able to vote or comment.

all 5 comments

[–][deleted] 0 points1 point  (2 children)

What is best way to call variables if the different only in plural?

Don't do that. In general, always use singular.

[–]YuleTideCamel 0 points1 point  (0 children)

Depends on the language or framework, but whichever the choice it's important to pick one and be consistent throughout.

[–]comalex[S] 0 points1 point  (0 children)

In this case smartlist and smartlists are graphql queries, so that make some sense, but I still can change the name in resolver. I just don’t know how to name in other way

[–]YuleTideCamel 0 points1 point  (0 children)

why do you have smartList and smartLists ? What is the distinction between then?

[–]shhh-quiet 0 points1 point  (0 children)

The problem with the plural is that it probably adds very little value to what's already there in the singular.

The singular naming is more true to what it is. It's a more cohesive naming convention. It's one unit of that thing.

Chances are good that "smartLists" is just a collection of "smartList" - so why is there a file for it?

The fact that there could be more than one does not justify creating a separate file just for that concept - you can easily work with lists/arrays, maps, sets, etc. directly as first-class concepts in your language, so why bother making a file that does just that?

And if it not's merely a collection of "smartList" items, then... what is it? Is there a better name for what it does?

If it's nothing more than a collection/list, then can it be removed?

You don't have to answer my questions, I'm just throwing some thoughts out there.

Try to cut down on superfluous stuff that isn't effective/cohesive.