Questions tagged [naming-standards]

Naming standards is about defining rules about the use of symbols such as the name of namespaces, packages, modules, types, functions, or variables

Filter by
Sorted by
Tagged with
-3 votes
0 answers
58 views

Are there conventions for naming functions which query and return results from a database? [closed]

Our team's codebase contains functions which perform SQL database queries and return their results. At the moment, we don't follow a standard naming convention for these functions. As a result, we ...
Andrew Parsons's user avatar
-2 votes
3 answers
378 views

Common practice where to place "is" word while naming predicate function: at the beginning or in the middle?

There's a lot of free or member predicate-like functions (that returns boolean value) in different programming languages and popular libraries/frameworks that have "is" as a prefix, e.g.: ...
αλεχολυτ's user avatar
0 votes
3 answers
154 views

Naming multiple Entities of same collection (with different sets of fields, few less, few more)

Say I have a complex entity (class) called Quote. We have one representation that has just 3-4 fields used to hold minimal amount of data to identify a quote. Is there any convention to call an entity ...
tgkprog's user avatar
  • 607
0 votes
1 answer
164 views

What would be good alternative function names for "filterHighNumbers"? The word "filter" could go either way [closed]

The problem I noticed is that I wrote a function called filterX which removed any X from a list. Then another engineer came along and wrote a filterY function which kept only the instances of Y in the ...
ubershmekel's user avatar
0 votes
2 answers
97 views

Is usage of "with" prefix acceptable for filter methods that are specific(not generic) [closed]

I am not a native english speaker so I have the following question related to naming I have a class that has generic filter method of type: filter(Predicate predicate) In the same class I have some ...
Alexander Petrov's user avatar
4 votes
5 answers
330 views

Naming a method that does the same thing faster but only approximates the result?

Presume I have a function that does some precise calculation on a large amount of data, call it calculateResult(data). This function gets very slow with increasing size of input. Luckily, I only need ...
csstudent1418's user avatar
1 vote
4 answers
3k views

What's the convention to name a REST endpoint that returns a boolean?

I have an endpoint that returns whether a resource is valid or not (true or false): GET resource/{id}/valid Where the returned value is not a field of the resource and is dynamic, it does not depend ...
Marco Lackovic's user avatar
-1 votes
1 answer
76 views

Workaround for digits in beginning of identifier

Suppose I have a std::span-like type, that represents a matrix or an image, or a class modelling a 3d mesh. I would like to say template<class T> class 2d_span; class 3d_mesh; But that would ...
user877329's user avatar
23 votes
5 answers
6k views

Best Practice - Avoid naming class and field the same?

When modeling classes I always have stumbled on the problem that the class has a field with the same name. Look at this example: class Name { string meaning; string language; string name; /...
bubbletea's user avatar
  • 347
0 votes
2 answers
421 views

Can a UUID be called a constant?

From my understanding, a constant is a value which is assigned only once and cannot change at runtime, whereas variables have mutable values which are unpredictable by nature. My question is, to what ...
Clara's user avatar
  • 53
3 votes
4 answers
250 views

Does it make sense to use the word 'Set' in a class as an umbrella term for both sets and individual items?

For instance, if I'm modeling a book collection and I want to be able to represent sets of books that come together (like an encyclopedia series), the sets may share a lot of properties that ...
user6490576's user avatar
0 votes
1 answer
350 views

Best way to name derived classes when extending its functionality [closed]

I have just recently joined a new company and one of the classes used to log information has not been written properly. So I have been asked to add new functionality to the logger. Rather than ...
user16405900's user avatar
3 votes
2 answers
11k views

Naming convention for Boolean arguments

In many languages, the convention for naming Booleans is typically to prefix them with "is", "has" or "can". This convention seems to be applied mostly to fields and ...
k314159's user avatar
  • 141
2 votes
1 answer
2k views

Naming Conventions for microservices

We are currently splitting up our Intranet monolith into multiple (Micro)services. The layout in itself is already finished and we have decided to split them up in a way that there is only ever one ...
SirHawrk's user avatar
  • 239
3 votes
3 answers
2k views

Why would you have a different namespace for each folder in a C# project?

I can't see how having a namespace for each folder makes sense. As near as I can tell, the point of having namespaces is to avoid name conflicts. But, Microsoft, in their namespace naming conventions, ...
Josiah_Maddux's user avatar
-2 votes
1 answer
99 views

Can a local application be called a "client"? [closed]

I'm developing an application that has no client-server connection by design, all of the work is done locally (no internet connection needed), so I'm wondering if I can call it a client? (I'm asking ...
SmallDevice's user avatar
10 votes
7 answers
2k views

Are there historical problems with non-ASCII identifier characters in code?

I frequently encounter recommendations to specifically keep to ASCII characters in field and function names in documentation, even though non-ASCII (modern Unicode) generally works perfectly. An ...
Michael Macha's user avatar
1 vote
1 answer
3k views

Appropriate naming for (GitHub) repositories belonging to the same project [closed]

I have some issues selecting an appropriate naming scheme for GitHub repositories that belong to the same project. The main package repo relies on additional repos to generate documentation or run ...
mluerig's user avatar
  • 137
0 votes
1 answer
451 views

AWS Java Lambda Class Naming Convention?

I wonder if there is a naming convention or a best practice to name Java Classes when building AWS Lambda functions with Java for REST API? For example, if I have a Java project that contains Lambda ...
InterestedDev's user avatar
3 votes
5 answers
3k views

Am I understanding the new C# naming conventions right?

A couple months ago, Microsoft updated their C# Naming Conventions (https://docs.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions). As the developers of C#, I consider ...
Evorlor's user avatar
  • 1,412
2 votes
3 answers
1k views

Versioning a function/method

While this might seem more like a piece of an easy task to others, it's honestly not easy for me. At this stage, I find myself wandering how best to version my functions/methods. What does this mean? ...
Wale's user avatar
  • 141
-2 votes
1 answer
1k views

Git semantic commit versioning for file deletions

What commit type should I use when I'm deleting files from a repo? I have seen several types over the internet, but none talk about file deletions. Possibly the closest options that come to mind are ...
Asif Kamran Malick's user avatar
1 vote
1 answer
1k views

Naming for services/workers ect

I'm kind of new to this "separate your methods from models" (yes I was one of those developers). From what I understand I have to separate everything into models, services and factories. A ...
ikwillem's user avatar
  • 121
8 votes
6 answers
6k views

Does using the word "base" in a class name indicate abstraction?

I'm wondering if there is a widely accepted convention for naming base classed in OOP. Does marking a parent class with "Base" indicate that it's abstract or that it's just an extended class?...
alamoot's user avatar
  • 189
2 votes
4 answers
784 views

Naming convention for functions that mutate arguments vs creating a new object

Take the following signature BigInt* addBigInt(BigInt* arg1, BigInt* arg2); Traditionally, the safest way to implement this function would be for it not mutate the arguments, and would necessarily ...
Chad Harrison's user avatar
-2 votes
1 answer
89 views

How are methods called that prepare/alter some data and then pass it on

I am currently trying to name a method that prepares/alters some input data, then passes it on, and I'm wondering if there is a naming scheme for such methods. Concretely, I have a reusable UI ...
BlackWolf's user avatar
0 votes
0 answers
571 views

Spring boot, n-tier layer structure naming conventions

I am currently developing a huge project in my company with N-Tier Layer architecture using spring boot but I can not sure about the package and class namings. In our project, we have a complex ...
nsk's user avatar
  • 9
5 votes
2 answers
1k views

Function naming: choosing the order of nouns / verbs in the name

I'm sometimes torn between two naming conventions defining the order of words that make up a function name. The first one is choosing the words in the same order we would natural use in a sentence, ...
Petras Purlys's user avatar
-3 votes
1 answer
408 views

Standarized prefixes for naming REST POJO (Bad or good practice)? [closed]

We are building a software application for a client with a particular naming convention for REST services. For example if you use a POJO for your request or response in a REST service something like ...
Cesar Miguel's user avatar
4 votes
3 answers
299 views

Naming function with "proceed"

I am wondering if it is good practice to name function which does the main logic "proceed" + "functionName". I would use that name if there are some checks(if-s, try-catches, etc.) ...
Jakov's user avatar
  • 151
-3 votes
1 answer
74 views

What could be a better naming convention for the variable 'completeConfig'?

I have a feature in which the user can directly provide the entire nginx config inside the completeConfig variable in the config yaml. Like this: nginxConfig: completeConfig: > .... .... ...
Siddharth Gupta's user avatar
0 votes
2 answers
259 views

Which approaches are exists for using of possessive case in variables/classes/methods naming?

In variables/classes/methods naming, sometimes "of" preposition is omitted and word order changing, for example: "Absolute path of source file of entry point" -> "...
Takesi Tokugawa YD's user avatar
4 votes
2 answers
213 views

Should the name of a method be less descriptive if its class/module alread is enough?

I have a module or class Random and in it there's a method called generate(). A client will always call it as res = Random.generate(). And from the inside, obviously, it can be called simply as ...
kosmosu05's user avatar
3 votes
3 answers
2k views

What is a good naming convention for Interface Adapters, Use Cases / Interactors, Entities?

I'm using MVVM + Clean Architecture in my app. And I sometimes don't have any idea if my namings are good enough for each Interface Adapters, Use Cases / Interactors, Entities. For View Models, it's ...
Bawenang Rukmoko Pardian Putra's user avatar
-3 votes
2 answers
604 views

Naming conventions for set/unset method parameter

I have some class MyClass which has two methods: Lock(){} Unlock(){} For some reasons, the two methods are to be unified into one, with an additional parameter for indicating the action. What should ...
Gulzar's user avatar
  • 1,240
0 votes
1 answer
172 views

How to avoid messy code when working with different libraries

I'm planning to work with different libraries that use different conventions. One uses snake_case, another one uses camelCase. This leads to code that looks like I can't make up my mind: Some_Result ...
infinitezero's user avatar
1 vote
6 answers
3k views

Naming boolean fields in classes

I have had hard times naming boolean fields. On the one hand, i've read that it is good to name them as affirmative statements, like hasAge, or canDance. It's not a problem when naming local ...
Kamil Bęben's user avatar
-4 votes
3 answers
819 views

Should I prefix keys of JS object with the object's name?

Let's get to an example. Suppose, I have a Course object with the following properties: (course' code, course's title, credit of course etc.). When expressing this as a JS object, I can do it in the ...
Jahirul Islam's user avatar
1 vote
2 answers
814 views

How to name two versions of the same object, where one has a smaller amount of data and one is the "complete" object

What is the best way to name two classes that describe the same object, but where one of those classes does not hold the complete information? And should I make one of the classes inherit from the ...
mft25's user avatar
  • 161
11 votes
2 answers
2k views

What form of verb to use (imperative verb or third-person verb) in programming?

Here are a few examples: Imperative verb Initialize! InitializeWhenCreated! RequireValue! Third-person verb HasValue? RequiresValue? Are there some rules how to choose either imperative verb or ...
Denis535's user avatar
  • 277
24 votes
3 answers
8k views

Why are module-specific prefixes widely used for function names in C modules?

In some C projects, function names start with a common prefix indicative of the module name, for example: mymodule_do_this_stuff(); mymodule_do_that_stuff(); Is there a justification for doing so ...
user6007354's user avatar
2 votes
3 answers
1k views

Use prepositions in naming verb-phrase functions?

When writing a library, designing a class or extending some existing API, we often need to express actions or relations involving noun entities: "Place the ball in the bin" "Obtain the coat for the ...
einpoklum's user avatar
  • 2,496
-1 votes
2 answers
1k views

Python function name convention for "convert foo to bar", e.g., foo_to_bar, foo2bar

I have a function that converts args given by argparse to a filename: def args2filename(args, prefix): filename = prefix kwargs = vars(args) for key, value in sorted(kwargs.items()): ...
Yamaneko's user avatar
  • 117
2 votes
3 answers
2k views

Should I give an object that holds multiple objects of the same type a plural name?

I have an object: const riders = { Dave: { gender: 'male', age: 13, }, Nina: { gender: 'female', age: 16, }, Mike: { gender: 'male', ...
yaserso's user avatar
  • 189
2 votes
2 answers
2k views

API naming for authentication API composed by many steps

I have an API which include a registration and login process. Both process have an authentication sub-process. This sub-process are many steps which API validate a client specific data. I have many ...
Cesar Miguel's user avatar
2 votes
3 answers
3k views

How to name functions with multiple return values

In many languages, it is common for a function to have multiple return values (as a tuple), such as: def foo(): return "Hello, World!", 0 I often do this when a computationally expensive (or an ...
Ali Rasim Kocal's user avatar
1 vote
3 answers
1k views

How should I name output variables that are the same as the function?

What are some conventions for naming a variable in cases where the name of the variable ought to be identical to the name of the function? I'm using VB.Net. I often have this problem when writing ...
Bernoulli Lizard's user avatar
2 votes
1 answer
120 views

Naming a software which allows communication between two independent systems via internet [closed]

Probably a trivial question but I just don't know how that piece of software would be called correctly: I have a closed system (A) and an application on another system and location (B). The ...
spcial's user avatar
  • 137
1 vote
2 answers
219 views

naming the classes for users of my app, and users who manage the app

Naming things is hard but naming them properly is really hard. We are working on an app, that analyzes the data of multiple apps and creates some reports. And we are hitting our heads against walls ...
lahory's user avatar
  • 315
-1 votes
2 answers
379 views

Common way to name methods with same name as desired variable? [closed]

I frequently find myself pulling up helper methods in order to make my code better, but end up with duplicate method names. Is there a standard way to name such methods without getting duplicate names?...
Adam Thompson's user avatar