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
1answer
125 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 ...
11
votes
3answers
2k views

In Java 8, is it stylistically better to use method reference expressions or methods returning an implementation of the functional interface?

Java 8 added the concept of functional interfaces, as well as numerous new methods that are designed to take functional interfaces. Instances of these interfaces can be succinctly created using ...
2
votes
2answers
523 views

Is there a commonly accepted name for functions that are only called in one other function?

Is there a name that is commonly used for functions that are only called in one other function? (I'm not asking whether it's a good practice; I believe it can improve readability in some cases.) ...
26
votes
4answers
21k views

C# namespace and class naming convention for libraries

I'm building libraries with various small utility functions in C#, and trying to decide on a namespace and class naming convention. My current organization is like this: Company Company.TextUtils ...
5
votes
4answers
302 views

Variable name which sometimes refers to an object and sometimes to a string

Sorry for the confusing title - this is best illustrated by an example (hypothetical but hopefully illustrative). For 99% of my application a Zip Code is considered as a string, so I consistently use ...
4
votes
1answer
253 views

What is a term for iterating over many functions with the same input?

When we call the same function on a list of things, we call that "map". What do we call it when we call a list of functions on the same data? I don't mean pipe - not feeding the output of each ...
-1
votes
1answer
125 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
vote
4answers
387 views

How do you explain the importance of writing classes over writing procedural functions to a programmer? [closed]

I have an intern and he writes code fast. However, I have difficulty making him understand the importance of writing classes and follow the OOP paradigm. We recently had a discussion that went like ...
64
votes
7answers
8k views

How to name something when the logical option is a reserved keyword? [closed]

Occasionally, the most logical name for something (e.g. a variable) is a reserved keyword in the language or environment of choice. When there is no equally appropriate synonym, how does one name it? ...
4
votes
9answers
564 views

What is a widely accepted term for a string variable that would probably contain a file path and file name?

For functions that need to index files in a directory and rename them FileName0001, FileName0002, etc... I often need to write a function that splits the file name from the file path and rename the ...
-1
votes
2answers
5k views

Is it best practice to always capitalize class file names in PHP, and other languages? [closed]

I ask because I've seen a couple of OO PHP tutorials which do not adhere to this, but to me it just makes sense. It makes it easy to instantly see if a file is a class or not, if non-class files all ...
3
votes
1answer
201 views

Are there any scenarios where a JS function expressions would need to refer to its “name”?

Anonymous function expressions in JS bug me as they make stack traces and Chrome Dev Tools profiler output harder to use, so I've decided to name ALL my function expressions from here on in. The ...
25
votes
8answers
21k views

Meaningful concise method naming guidelines

Recently I started releasing an open source project, while I was the only user of the library I did not care about the names, but know I want to assign clever names to each methods to make it easier ...
-1
votes
2answers
300 views

Naming software products and tools? [closed]

Instead of unintelligible names and acronyms for new products and services, is there any other way of naming software that could also say what it is and what it does? For example, instead of naming a ...
2
votes
2answers
291 views

When should I use “value” as an argument name? [closed]

I'm building my own utility functions to master ES6: const contains = (array, value) => { return array.indexOf(value) > -1 } const keys = (object) => { return Object.keys(object) } ...
3
votes
1answer
1k views

How to name method specific DTOs representing the same entity?

I'm building a Web API. To give meaning to my controller methods I want classes that specify what properties are used for each particular operation. This would make the code easier to understand, and ...
2
votes
1answer
1k views

Is there anything wrong with my project structure and naming convention in ASP.NET MVC and Web API?

I wonder if project structure and naming convention which I use in ASP.NET MVC and Web API projects are ok. These technologies are quite new to me, so I don't have my own standards yet. I don't ...
-1
votes
1answer
148 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 ...
2
votes
1answer
124 views

What is the correct name for a conditionally present flag/field in an interface?

It looks like there's a problem with our deploy process where old versions of our service are being deployed to certain clusters, but it's hard to tell exactly what's wrong, since all we have as data ...
35
votes
10answers
9k views

What naming anti-patterns exist? [closed]

There are some names, where if you find yourself reaching for those names, you know you've already messed something up. For example: XxxManager This is bad because a class should describe what the ...
1
vote
1answer
201 views

Is using uncommon words as descriptive variable names acceptable?

I am implementing a finite state machine in Python 2.7, and I am considering using an English word that I don't commonly see in code: "stimulus". I have a transition function that accepts some kind of ...
2
votes
1answer
1k views

How to name Test Projects

Suppose I have some Modules that each are their own component I would now have different Testprojects spanning different modules. UnitB_UnitTest, UnitC_UnitTest, GUI_UnitB_ComponentTest, ...
13
votes
2answers
7k views

How should I name functions that return values in Python?

I'm confused about choosing names for my functions in Python. Sometimes Python built-in functions are imperative such as: print function and string method find. Sometimes they aren't such as: len its ...
0
votes
0answers
117 views

Qt Naming Schemes for returns of boolean member variables: enabled(); vs isEnabled(); ?

In building my classes, I have noticed that I have not been very consistent about naming my boolean returns. In Qt; I notice that many of their classes use the is prefix, but checking their coding ...
9
votes
3answers
2k views

Naming convention for functions which have side effects? [closed]

I heard somebody say their language has a convention where the names of functions which mutate state must end with an exclamation point. I'm trying to write more functional code and I like the idea of ...
0
votes
1answer
181 views

Is there a name for this kind of function?

I'm a data analyst, not a software developer, and I often find myself writing a function like this (shown in Python syntax here): def apply_many(arg, *funcs): return [func(arg) for func in funcs] ...
-2
votes
2answers
862 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 ...
10
votes
4answers
713 views

What is the name of the functional argument in fold

In the higher order function fold/reduce what is the name, if any, of the functional argument? I am working on a monadic tabular processing library where rows are folded to produce simple analyses (...
12
votes
1answer
6k views

What does `Resolving` mean in programing? [closed]

I see in many places where the word Resolve is used, in Dependency Injection (resolve an implementation to an interface), Package Managers (ex: Resolve packages dependencies), Web (ex: Resolve a ...
1
vote
2answers
987 views

C# namespace and class naming

I have a small issue with namespace and class naming. Here is a practical example: ResourceLayer.cs - Public component that holds the manager and the map provider, implements an interface ...
2
votes
0answers
76 views

What sort of object represents a table row from a joined table query? [closed]

I have a conceptual problem here. When i query my database, i often do so with joins. So a result set row might look like +------------+--------------+------------+-------+----------+----------+------...
14
votes
6answers
18k views

What naming Convention to Use for C# Function Parameters

There are situations when a name passed in Parameter will be Cast into a new type, but the name of the Passed object should remain similar. For the case of Class Attributes, we can use this operator, ...
3
votes
3answers
141 views

Should I implement a obfuscated spec literally?

I'm tasked with implementing a spec for a simple simulated shopping system. The spec however uses strange abreviations everywhere (it has a 2 page long table of nonsense abreviations). For example the ...
0
votes
1answer
117 views

break down test class into multiple file naming convention

I have a test class with about 25 tests that are testing the different aspect of it. I wonder Should I break it down into smaller classes? If so, then what is the best naming/packaging convention? ...
1
vote
1answer
231 views

Name a predicate function that takes multiple objects [closed]

I have the following JavaScript code: function tokensOnSameLine(node1, node2) { return node1.line == node2.line; } What would the preferred name for this function be? I've considered the ...
2
votes
4answers
2k views

Best practice for RESTful API calls with variations

How do I name API endpoints that serve the same entity in different ways and still adhere to the RESTful API guidelines? Let's consider I'd like to get a customer with ALL his details. I just expose ...
3
votes
3answers
1k views

namespaces and header guards with naming conflicts

C++ has namespaces to prevent collisions of things with the same name. Header guards serve a different purpose. They prevent includeing the same header twice. However, they can suffer from the same ...
2
votes
1answer
668 views

ASP.NET MVC Middle tier object naming

As a corporate developer who works alone I find myself creating and writing a lot of websites that consist of screens that are basically wrappers for a DB table. So for instance on a screen that ...
44
votes
15answers
14k views

Is it bad practice to name an unused variable with a single underscore?

Often when the syntax of the language requires me to name a variable that is never used, I'll name it _. In my mind, this reduces clutter and lets me focus on the meaningful variables in the code. I ...
1
vote
3answers
368 views

Is it a good idea to have a method that starts with get without being an accessor?

Let's say you implement an interface like: public interface Example { InputStream getThatContent(); } In this case there is no property, and the implementation may also have side effects (it can ...
2
votes
1answer
78 views

In what namespace would I place “Doers”

This might sound weird and probably is, but I am struggling to find a good place where to place what I will just call "Doers" for lack of a better name. Basically, my project currently has these ...
1
vote
2answers
321 views

How to name variables that clash with functions?

As an example, in Python I have a lowest_prime_factor function which does it exactly what it says it does. Then, in another function, I need to call this function and store it. In another language ...
0
votes
1answer
37 views

Should I create a function that filters and returns a mutated copy of the filtered values?

Say I have a function whose input is an array of fruit objects, and returns a list of *cloned) apples from that list, with each cloned apple mutated with an additional property visible on it. Would a ...
3
votes
3answers
1k views

Version-postfixed class name for REST api

I'm working on a Spring-based REST api that has v1 and v2 variants: /api/v1/dates /api/v2/dates Correspondingly, there are v1 and v2 packages in the code base: com.company.api.v1 com.company.api.v2 ...
11
votes
1answer
9k views

Naming convention for test packages

We're actually naming our test packages just like their to-test counterparts. So we end up with this structure: src/main/java com.hello.world helloWorld.java src/test/java com.hello....
25
votes
2answers
41k views

Naming convention: Final fields (not static)

Today I had a discussion with a co-worker about the naming of final fields in Java classes. In his opionion final fields should also be considered constants since their values won't change after the ...
14
votes
5answers
3k views

How to organize localization string resources?

We're developing a large application, consisting of many small packages. Each package has its own set of resource files for localization. What's the best approach to organizing and naming the ...
1
vote
2answers
3k views

What should be the ideal length of a variable name in Java? [closed]

I try to find out not according to semantics but weight. I mean, should I take care when set a long name to a variable?
-1
votes
1answer
147 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
vote
3answers
2k views

Should class names reflect namespace name?

Is it generally considered good practise for a class name to reflect the namespace name it exists under, or should the namespace name implicitly be considered part of the class name? For example, ...

1 3 4 5 6 7 12