Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

-1
votes
3answers
178 views

Naming a class that decides to retrieve things from cache or a service + architecture evaluation [closed]

I'm a junior developer and I'm working on a pet project that I want to learn as much as possible from. I have the following scenario: There's a WCF service that I use to retrieve and update data, ...
-1
votes
1answer
118 views

What can we call a model, controller, and related views? [closed]

When developing an application using the MVC pattern, I often find myself adding a new model, a new controller, and a new set of views for the actions in the controller. These changes are pretty ...
-1
votes
1answer
144 views

How to name a class whose purpose is to hold related objects?

I am working in a wizard in WPF application. As the wizard gathers a lot of information I have designed separate view models for each step (view) in a wizard. But I have to hold all this information ...
-1
votes
2answers
181 views

Naming methods that perform HTTP GET/POST calls? [closed]

In the application I am currently working on, there are generally 3 types of HTTP calls: pure GETs pure POSTs (updating the model with new data) "GET" POSTs (posting down an object to get some data ...
-1
votes
1answer
44 views

How to name base classes so that it's most convenient for those extending a framework? [closed]

I'm designing a game engine that is supposed to be overridden. I have, for example, a class called Character. Should I prefix this with BaseCharacter or should I expect that whoever uses the framework ...
-1
votes
1answer
566 views

Should objects be singular since arrays are plural?

Might be a silly question, but what is more logical: object.actions.bark() or object.action.bark()? Simply about plurality. I know arrays are usually pluralized. But if I were to be consistent; ...
-1
votes
2answers
158 views

Naming convention for classes that represents different versions of the same thing [closed]

Let's imagine I have an abstract class named ProtocolA that represents the basic operations to work with the protocol A. Such protocol is in version 1, but new revisions are expected in the future. ...
-1
votes
1answer
145 views

What is the naming convention for this type of object [closed]

I have frequent "access" classes that implement interfaces / abstract classes. These classes all have different classes/ dlls to execute the implemented method. What naming convent is commonly ...
-1
votes
1answer
114 views

method to check nested transaction

So I am writing a method to check and throw if a new transaction is being made in another transaction. I first came up with straight forward checkNestedTransaction, but this seems vague since I cannot ...
-1
votes
1answer
65 views

How to name functions which continue a process after an asynchronous step

Say that you have an web application which prints pages in a document. Suppose that after validating the page range, the application does the following: If a billing option is turned on, it first ...
-1
votes
1answer
631 views

What to name package and their facade classes?

I'm using a some C++ Facade classes like this: Suppose that there is package named "SubSystem" with a lot of classes inside, like in the picture above. I cannot name the package of the facade ...
-2
votes
7answers
2k views

C++ namespace name isolation

It's been considered for a reason, that using for namespaces/names is side-effect-prone, and generally, fully qualified names should be preferred. I've come up with an approach on that, which I ...
-2
votes
3answers
97 views

Adding qualitative information to function names

I started adding informations about the behavior of functions to their name recently. Two big examples: pure - this function has no side effects (besides the returned value), which I would use in ...
-2
votes
1answer
228 views

Should I limit my type name suffix vocabulary when using OOP? [closed]

My co-workers tend to think that it is better to limit non-domain type suffixes to a small fixed set of OOP-pattern inspired words, e.g.: *Service *Repository *Factory *Manager *Provider I believe ...
-2
votes
1answer
64 views

What is a common name for a module being tested?

When writing unit tests, I want to reduce the cognitive load of the reader as much as possible. One thing I've noticed that bothers me is that the variable names of the thing that is being tested are ...
-2
votes
2answers
733 views

Java - is it bad to name variables starting with uppercase if they are vectors or matrices? [closed]

Often in math a vector or matrix will be denoted by a single capital letter. Would it be bad to have some variables such as this? Vector3 A = ... int Bx = ... int By = ... int Bz = .. I would ...
-2
votes
2answers
105 views

What would you call two elements in an array that are only related to each other through their positions? [closed]

I have an array that holds valuable data related to what I stored in a setup / onboarding process: $imported_headers = [ 'headers_2', 'headers_3' ]; Given the fact that these elements are from the ...
-2
votes
2answers
55 views

Interface name for time-based classes

I'd like to document that code encapsulated in a class is "time-based" in a Java-like language – the code behaves differently based on what time it is currently. To make it testable, it would read ...
-2
votes
2answers
43 views

Naming lower and upper threshold of a metric

I am creating an API that will expose a list of metrics data. Each metric data will contain the following: metricName lowerThreshold upperThreshold The defined thresholds here are what will ...
-2
votes
2answers
278 views

Name for this pattern? [closed]

I'm writing a class that will handle thread synchronisation. It would have a begin method which would increment a counter and an end method that would de-increment a counter. It'll have another ...
-2
votes
2answers
203 views

What do you call a cron that cksums all your files and writes them to a database? [closed]

It is a way to take inventory of many cgi scripts and web applications in a Software Service environment. It will be a way of creating changelogs and to keep track of which customers have which ...
-2
votes
1answer
68 views

What to call a API and DB code layer [closed]

In a recent MVVM mobile app project I wrote a set of API classes and Database classes where there was a clear flow of logic between both api and db code. To enforce the way api and db interacted I ...
-3
votes
3answers
309 views

What is the abstract name for Drive, Directory and file? [closed]

I want to give nice name to my function while returns drive, directory and file. Can you please suggest a good abstract name for this trio? This is the function. static IEnumerable<string> ...
-3
votes
3answers
139 views

Method naming advice required [closed]

My question will be about how do you think it would be fit to name some methods in a fluent interface. Let me try to demonstrate the problem. Consider this relation tree: A person can have dogs and ...
-3
votes
3answers
163 views

Ambiguous use of “User”

In one of my projects, I had to name some variables and functions that belong to the person using my app. I named them userCard, getUserInventory() and so on. I named them like that cause there were ...
-3
votes
1answer
19 views

What's the proper name for code that tests another code?

That seems like a stupid question, but I can't find a proper name for "code that tests another code". The most of literature names that kind of code just "tests" but it's way to general in my ...
-3
votes
1answer
127 views

How to name the function of a thing differently than the thing itself?

A sensor identified by the serial number “ABC1234” fulfills a measurement function identified by the name “Pressure sensor 7” in a production facility. Within the production facility, nobody cares ...
-3
votes
3answers
71 views

Naming: How do you call an interface that allows to retrieve items?

Let's say a client need to get a list of products from somewhere. He does not care if that list comes from a cache, from a remote database, from a local database, from the resources or from the remote ...
-3
votes
2answers
369 views

Writing readable code and not overdoing it with naming [closed]

I've been in an argument at work about writing readable code. It was mainly about variable and method names and the idea that comments are worthless if the code is readable enough. I would not like to ...
-3
votes
1answer
110 views

Is it bad practice to give a directory and a file the same name?

I have a program that produces a command line tool called GetFood. The source code lives in a directory named GetFood/, and I have a main file that interacts with a class that gets the food. It seems ...
-3
votes
2answers
147 views

How to name the parameter that holds `next` middleware in the chain?

I am writing an implementation of middleware chain in Python. Here is how a middleware function looks like: async def logger(ctx, next): print(f"Started doing stuff with {ctx}") await next() ...
-4
votes
3answers
1k views

Why different languages have different syntax? [duplicate]

Different programming language always/most of the time use different syntax. For example take PHP, Java and Python. In Php & Java semicolons are compulsory at the end of the line, yet Python ...
-6
votes
1answer
593 views

Class names with Verbs

So I am reading Clean Code. In the Meaningful Names chapter, they lay down a rule of no verbs in class names. However in the Adding Meaningful Context section of that chapter, on page 29, he uses a ...
-8
votes
1answer
1k views

Class library naming conventions [closed]

Typically in a C# program, the entry point is in Program.cs. However, if you are creating a rather generic class library, with no Main() method, such as TCPClient.dll what is the appropriate base ...