Questions tagged [naming]

Give meaning and explanation with the fewest number of characters in a form that is most accepted by your team or community at large.

Filter by
Sorted by
Tagged with
0
votes
1answer
46 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 ...
-1
votes
0answers
33 views

Alternative verbs for a factory style operation

What verbs, other than 'new' and 'create', are being used for factory style operations? The reason I'm asking is that I'm not quite happy with my current way of naming the family of functions ...
1
vote
2answers
135 views

What naming convention should I use in Clean Architecture?

in the code base of my job, we use clean architecture standards. So we have controllers, use cases, etc. To name them, we follow this template: {name}{type}, where type is one of the following values: ...
-3
votes
1answer
99 views

General term to describe the anti-pattern where the same concept is described in different ways?

Our codebase is old and very large. Over the years, many developers have worked on the code and frequently refered to the same concept inconsistently. For example, we have a "number that uniquely ...
3
votes
4answers
167 views

How name public method that relays to abstract methods of its children (c#)

I've run into the following situation multiple times, and in every case have struggled with the naming. I want a class to force its children to implement a method, but I want the parent class to be ...
4
votes
6answers
371 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?...
0
votes
1answer
85 views

Pattern name to compare previous raw values to current values

I find myself applying a certain pattern again and again and I assume I am not the first one. I am looking for a name. In the environment I find myself in we get updates to values via an external ...
1
vote
1answer
56 views

Distributing responsibilities in a micro service in an Object Oriented manner for a 3rd party integration?

I'm trying to figure out how to structure a 3rd party integration microservice, and how to name the classes accordingly. If you had a classic shopping cart application which processed payments for ...
2
votes
1answer
241 views

What is the name of this pattern / style?

We have a "workflow orchestration" system at work. It works something like this: You configure what to run (in a database table), such as: NameOfStepATHingToRun ="weather_data" ...
-2
votes
1answer
50 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 ...
-2
votes
1answer
185 views

Why is it so often written “myID” instead of “myId” [closed]

I very often see code containing the variable names "myID", while "ID" stands for "Identifier". Why should it be ID? The same goes for GUID/UUID, shouldn't that be GUId/...
3
votes
2answers
170 views

Is there a canonical list of standard verbs to use for method names?

I was trying to explain something to a junior programmer the other day, and as part of it I had to explain that: a method with 'find' as the verb in it, will either find an item and return it, or ...
0
votes
1answer
100 views

What would you name the different DTOs for the methods “GetUser” and “AddUser”?

I have a web service with the methods GetUser and AddUser, and some DTOs (Data Transfer Objects) GetUser: retrieves user information, as a DTO called UserGet DTO AddUser: takes a DTO called UserAdd, ...
0
votes
0answers
31 views

Terminology for cumulative vs non cumulative functions on timeseries data

Say you had some (contrived) timeseries data like: time | 1 | 2 | 3 | 4 | 5 | temp 1 | 3 | 3 | 4 | 4 | 5 | temp 2 | 2 | 2 | 2 | 2 | 2 | ...etc Is there a particular ...
0
votes
0answers
53 views

Is it a bad practice to have a class with a namespace that goes “out” of it's project name?

I have a solution with multiple projects, lets suppose there's one project with the name Company.Name.Foo.Bar. If I declare a class inside the project Company.Name.Foo.Bar but with a namespace Company....
3
votes
1answer
115 views

How to name a domain concept when experts use different terms?

The DDD literature is quite clear that when a word/term has a different meaning for different users, a Bounded Context should be created to be able to separate the domain models. I'm facing the ...
0
votes
1answer
34 views

Allowing a client to specify whether parameter is Required or Preferred

I am enhancing an existing API to provide shipping rates for a b2b web service. This specific endpoint returns a single rate based on matching request parameters such as the service level and package ...
2
votes
0answers
61 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, ...
-1
votes
1answer
41 views

Method parameter ordering [closed]

Assume that I am implementing a method that takes a data source in a system. Assume that it's a multi-tenant system, so a data source belongs to an organization (as other relevant entities, like users/...
-3
votes
4answers
116 views

What's should I call a Location (Longitude and Latitude) associated with a DateTimeOffset? [closed]

In the Xamarin.Essentials library there is a Location class that comes with a DateTimeOffset TimeStamp. I know I'm being pedantic and I should just move on - I know it's to indicate a location of the ...
-4
votes
2answers
54 views

Deciding on the name of a class

I'm working on a domain where we keep track of food that is stored on various locations, like the fridge or the cellar. While implementing the domain, I was wondering what the best name would be for ...
0
votes
0answers
41 views

How to name multiple entities returned from a Query Handler?

I've got the following flow: HTTP API is exposing data from 2 database tables that are combined into one JSON structure. We're implementing this using CQRS - splitting the reads from multiple tables ...
8
votes
5answers
373 views

How to map “mv” operation to HTTP verbs?

In designing a RESTful api the problem arises as to how best to allow resources to be moved between collections. Renaming a resource could be done by using PATCH but this is not the same thing as ...
0
votes
2answers
52 views

Does Get in Repo Imply GetById?

REST APIs in virtually all languages use methods named Get to get GetById(int id). Is it ok to use this convention for repositories? Let's say I have a Professions repository for the sake of example. ...
4
votes
3answers
202 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
2answers
160 views

Name for a “called function”

I am writing a documentation for a programm where a function is defined and it is called three times. I call the definition of the function "function definition". But what is the correct ...
0
votes
1answer
59 views

Guidelines for how to name annotations

Annotations/Decorators/Attributes are a language feature found in multiple languages, such as JavaScript/TypeScript, Java and C# to name a few. I've been trying to find some information about how ...
-3
votes
1answer
62 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: > .... .... ...
0
votes
2answers
124 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
2answers
209 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 ...
1
vote
2answers
291 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 ...
-3
votes
1answer
496 views

What naming convention should I use for a JSON RPC client API designed for multiple languages?

This is the documentation with the original RPC client API specification. The naming convention in the specification is camel case. Naming conventions might differ in subtle ways for different ...
-3
votes
4answers
110 views

Negative Naming in Forms

The Main Question Is it ever acceptable to use a negative name for a boolean variable? For example, I have a few user forms that have a checkbox for "N/A" or "Not Assessed". These ...
2
votes
2answers
225 views

Is there a name for a closure which just returns a value?

I have a PHP closure defined as function () use ($contents) { return $contents; }. It's like a value object except it's a closure. Is there a name for this?
2
votes
3answers
538 views

What do you call a function that returns a function?

Let's say, for example, that I have a function makeFoo that makes another function foo: function makeFoo(string) { return () => string } const foo = makeFoo('bar'); I know that makeFoo is a ...
1
vote
2answers
144 views

What do I call “unit tests” that are specifically developed during tinkering?

When developing a new section of code functionality with modules I'm not familiar, I'll often create a set of unit tests that are for "tinkering" and interactively analyzing the results in ...
-3
votes
2answers
105 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 ...
-2
votes
1answer
56 views

System Hungarian Notation for Android UI components?

Is using System Hungarian Notation for Android UI components (Views) valid? I mean using it ONLY for Views - no strSomething, boolStuff or similar names. For example, tvDescription (TextView), ...
-2
votes
1answer
100 views

Conditional command pattern

I have an abstraction that defines something like a command pattern, interface Participant { void proceed(); } Participants are grouped in a collection and are called all together. But each ...
-3
votes
1answer
49 views

Long variable naming with chained filters on API best practices?

I am writing an application where a single variable may be affected by different filters applied to the data that's read from the DB. Each different variation has to be stored (as each one serves ...
0
votes
1answer
110 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 ...
-2
votes
3answers
175 views

Is it acceptable to use “or” in the name of a boolean variable? [closed]

Say we have a boolean variable indicating whether an input array is 2D or 3D (just an example). Is it acceptable to name it is_2d_or_3d instead of is_2d, to make it clearer that if false, it indicates ...
0
votes
6answers
248 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 ...
-4
votes
3answers
169 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 ...
43
votes
10answers
10k views

Clean Code: long names instead of comments

Don't be afraid to make a name long. A long descriptive name is better than a short enigmatic name. A long descriptive name is better than a long descriptive comment. Robert C. Martin Did I ...
-1
votes
2answers
104 views

Do I name classes based on the object type they represent or the responsibility they have?

The more I read about the Single Responsibility Principle the less I see a class as an object type, but rather as a servant that does something. For example, let us suppose we have a new requirement ...
1
vote
2answers
42 views

Identify segment in grid

Imagine a grid like the one in the image. I have to model an API which identifies a single segment inside a grid (like the one painted in red). I thought the segment should be represented with ...
2
votes
1answer
112 views

What is the name of the throw-an-exception on invalid inputs pattern?

In some .NET libraries, there's a pattern of two alternative ways to call a function. int i = x.GetValue(k); /* Might throw. */ if (x.TryGetValue(k, out int i) { /*...*/ } else { /* ... */ } I ...
5
votes
3answers
257 views

What should a member function be called that applies an argument function to the object?

Apply is a fitting name for a member function of a function-type class that applies the function to the given arguments: class Addition { int apply(int a, int b) { return a + b; } } But ...
-2
votes
1answer
68 views

What do i call a 'Mutable configuration'

I have an external process in my program. To interact with it i have a configuration file i can edit. The external process then reads this file periodically and updates its state accordingly. Now ...

1
2 3 4 5
13