2022 Developer Survey is open! Take survey.

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
-1 votes
1 answer
40 views

Best practices for naming python utils / extending core modules?

So a lot of the time my utils end up with a structure that mirrors the core library. I might end up writing a multiline version of str.center, an itertools-y function that returns the first or last ...
user avatar
  • 11
0 votes
3 answers
179 views

Should I send the current or previous state with my state changed event?

I have an event that is raised when my job objects change state (e.g. initializing, running, complete, etc). The event is to be invoked from my set method in the State property, but before I make it ...
user avatar
2 votes
1 answer
259 views

Why is the 4+1 architecture model view named "4+1"?

Why are use-cases counted separately from the other views in the 4+1 architecture? How are use-cases different from others views?
user avatar
  • 139
-2 votes
2 answers
121 views

Guidance on naming methods that check data quality and then executes logic [closed]

I'm writing boolean methods that do a data quality check and then performs logic. such as isRecordValidAndIsUserPrivilaged. these methods checks the record validity, and then checks the user's access )...
user avatar
0 votes
1 answer
54 views

Correct selection of flags for extension

In my library (DLL), I have extensions for List like the next one. <Runtime.CompilerServices.Extension> Public Sub Store(Of TVal As IFullyOperable)(items As List(Of TVal), w As BinaryWriter, ...
user avatar
0 votes
1 answer
650 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 ...
user avatar
  • 127
1 vote
2 answers
86 views

What do you call a process which transforms objects of complex types into simple objects of primitive types? [closed]

My first thought was that I'm "serializing" the complex object, but from what I understand that means I'm reducing it down to a string or binary format which could be passed over a network. ...
user avatar
2 votes
1 answer
129 views

Naming convention for the classes holding REST APIs [closed]

Our new team suffixes class names with API to indicate that they encapsulate RESTful methods. Eg: "PaymentTemplateAPI", "FeeTemplateAPI" classes. I find it odd since API is a ...
user avatar
  • 139
-2 votes
1 answer
48 views

What should be a method prefix that makes calculation based on the parameter [closed]

I have a method, that takes a list of students, and returns the student with the best score. Part of me wants to call it Student getBestStudent(List<Student> students), but I think that get ...
user avatar
  • 121
1 vote
2 answers
81 views

Naming for a Class that performs one or more set operations

I'm designing a class that takes: 1 - An initial set of items (a simple collection/list) 2 - 1 or more Filter objects, that take the initial set of items and return a new set. Each Filter object may ...
user avatar
  • 21
0 votes
2 answers
133 views

How to manage ongoing development of two variants of the same library?

I'm the developer and maintainer of a FOSS C++ library, call it libfoo. There used to be just one variant of it; and I've made several numbered releases. Last year, I've created a second variant of ...
user avatar
  • 2,359
-2 votes
1 answer
68 views

What do you call a function that properly remains undefined?

Backstory: I have subclasses that are supposed to override and define various functions, but not neccessarily all of them. They can't remain purely virtual though for obvious reasons, and so I am ...
user avatar
  • 3,319
-4 votes
3 answers
121 views

Is there the difference between "symbols" and "characters" in programming?

I want to select between "symbol(s)" and "character(s)" for my variables' names in cases when these terms are synonyms. Please teach me some information which allows to make this ...
user avatar
0 votes
2 answers
317 views

Can a class be considered as a factory even though it only creates one concrete type of objects?

I have a simple class called Link that contains some properties, and use different classes for creating different types of links. My code looks like this: class Link { String reference, label, ...
user avatar
4 votes
2 answers
266 views

Should function names describe their parameter types?

If you wish to perform the same action using different parameters, you can either make differently named functions: public Apple findAppleById(long id){ return repo.findById(id); } public Apple ...
user avatar
  • 167
2 votes
3 answers
370 views

I need help naming a possible movement in a chess game

I'm working on a chess game and have created a base class for game entities and chess pieces, along with an enum for the state of a square, when returned in a collection of possible movements: public ...
user avatar
22 votes
11 answers
5k views

In a fluent interface with "with", is cloning expected?

In an object oriented language like Java or PHP (other perspectives welcome as well) if I use a fluent interface like this: my_pizza = (new Pizza).withTopping("pineapple"); another_pizza = ...
user avatar
  • 577
1 vote
2 answers
81 views

API for input stream operation read until

I want to create a stream class The input stream should read/parse a continuous range from left to right providing convenience methods. The implementation isn't a problem but choosing a consistence ...
user avatar
  • 119
2 votes
1 answer
289 views

GetOrCreate method for a database operation

I have read this thread: Is it bad coding practice to create something in a get if it does not exist? But, my question involve a method which gets a record from a database or creates it if it doesn't ...
user avatar
  • 129
0 votes
0 answers
71 views

Download method of type void vs response

Given a method that is widely used and has a void return type: from somepackage import download_model from somepackage import get_filename def download(name, download_path): response = ...
user avatar
0 votes
0 answers
42 views

Overloading vs another method for concrete example [duplicate]

Suppose, we have a create method: public void create(MyEntity entity, Foo foo, Bar bar) This method creates entity. Now, we need a method to create entity and lock it. And I see two solutions here - ...
user avatar
  • 145
6 votes
4 answers
531 views

Is there a standard name (or examples) for the "sandwich" pattern?

I've noticed a certain idea recur in different contexts, but before I start calling it "the sandwich pattern", it would be useful to know (in the spirit of other "Is there a name for ...
user avatar
0 votes
2 answers
163 views

What is the best practice to name a method that must either return saved result or resolve it?

Consider the following java code: public class Foo { private Bar bar; .... public Bar xxxBar() { if (this.bar == null) { //resolve bar this.bar = ...
user avatar
  • 145
0 votes
2 answers
142 views

Adjective for being okay to send via an unreliable protocol?

UDP is an example of an unreliable protocol. Is there a single word that means "okay to send via an unreliable protocol?" Sort of like "unimportant", but that's too strong a word. ...
user avatar
1 vote
1 answer
115 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 ...
user avatar
  • 121
2 votes
2 answers
974 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: ...
user avatar
-4 votes
1 answer
117 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 ...
user avatar
  • 140
4 votes
4 answers
366 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 ...
user avatar
  • 1,477
4 votes
6 answers
2k 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?...
user avatar
  • 149
0 votes
1 answer
104 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 ...
user avatar
  • 119
0 votes
1 answer
93 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 ...
user avatar
2 votes
1 answer
243 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" ...
user avatar
-2 votes
1 answer
52 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 ...
user avatar
3 votes
2 answers
237 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 ...
user avatar
  • 335
0 votes
1 answer
365 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, ...
user avatar
  • 111
0 votes
0 answers
39 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 ...
user avatar
  • 11
0 votes
0 answers
79 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....
user avatar
  • 329
4 votes
1 answer
161 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 ...
user avatar
  • 3,458
0 votes
1 answer
35 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 ...
user avatar
2 votes
0 answers
132 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, ...
user avatar
-1 votes
1 answer
45 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/...
user avatar
-3 votes
4 answers
121 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 ...
user avatar
-4 votes
2 answers
67 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 ...
user avatar
  • 93
0 votes
0 answers
75 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 ...
user avatar
8 votes
5 answers
423 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 ...
user avatar
0 votes
2 answers
58 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. ...
user avatar
  • 139
4 votes
3 answers
235 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.) ...
user avatar
  • 151
0 votes
2 answers
168 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 ...
user avatar
1 vote
1 answer
254 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 ...
user avatar
  • 129
-3 votes
1 answer
67 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: > .... .... ...
user avatar

1
2 3 4 5
13