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
171 questions
0
votes
1
answer
438
views
DTO Interfaces naming convention in PHP
It might be that my question would sound a bit stupid but I would like to find the best way for naming my DTO interfaces. In my PHP application I have following DTO types:
Simple (which contains a ...
-2
votes
3
answers
1k
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.:
...
2
votes
1
answer
549
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 ...
4
votes
5
answers
364
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 ...
-1
votes
1
answer
89
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 ...
0
votes
2
answers
757
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 ...
0
votes
1
answer
579
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 ...
3
votes
1
answer
3k
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 ...
-2
votes
1
answer
121
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 ...
2
votes
1
answer
4k
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 ...
3
votes
5
answers
4k
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 ...
-2
votes
1
answer
3k
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 ...
9
votes
6
answers
9k
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?...
-2
votes
1
answer
173
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 ...
5
votes
2
answers
2k
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, ...
4
votes
3
answers
355
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.) ...
0
votes
2
answers
327
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" -> "...
4
votes
3
answers
3k
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 ...
0
votes
1
answer
229
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 ...
-4
votes
3
answers
920
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 ...
13
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 ...
2
votes
3
answers
2k
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 ...
4
votes
3
answers
4k
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',
...
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 ...
2
votes
1
answer
172
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 ...