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.

0
votes
1answer
141 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
736 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 ...
8
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
2answers
714 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 +------------+--------------+------------+-------+----------+----------+------...
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
105 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
182 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 ...
3
votes
3answers
996 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 ...
3
votes
1answer
593 views

Why is Systems Hungarian commonly used in the VB world, and seemingly nowhere else?

Kind of as the title implies - I can understand why Apps Hungarian might crop up, but Systems Hungarian seems almost entirely pointless in a strongly-typed language. Why, then, is it so apparently ...
1
vote
3answers
320 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
73 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 ...
68
votes
8answers
11k views

Naming issues: Should “ISomething” be renamed to “Something”? [closed]

Uncle Bob's chapter on names in Clean Code recommends that you avoid encodings in names, mainly regarding Hungarian notation. He also specifically mentions removing the I prefix from interfaces, but ...
2
votes
1answer
123 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 ...
1
vote
2answers
270 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
33 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 ...
9
votes
1answer
7k 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....
1
vote
3answers
918 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 ...
1
vote
2answers
2k 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
637 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 ...
-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 ...
13
votes
5answers
2k 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
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, ...
0
votes
0answers
34 views

Name of the operation where whole table is put in array format

Consider this data struture: key1 : value1 key2 : value2 key3 : value3 I have an operation that put this data in array format: key1, value1, key2, value2, key3, value3 Which would the the name of ...
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 ...
0
votes
1answer
142 views

How to name this class? Is it a pattern?

I need to create a class which will have the following structure: public class MyClass { ArrayList<File> myList = new ArrayList<>(); public void addFile(File f) { myList....
2
votes
1answer
439 views

What is the opposite of UI?

I'm trying to find a good name for a library where I can put in all non-UI related code that I want to share between iOS apps (networking, filesystem, logic, algorithms, data structures). Names that I ...
3
votes
1answer
228 views

Bothered by an unknown letter case name

This side question bothers me: Has_This_Case_A_Name? Here is what I could find, but This_Case_Is_Missing: +---------------------------------------+---------------+ | Names ...
4
votes
3answers
6k views

Same class and namespace name

I have a problem how to go about naming my namespaces and classes. I already figured they shouldn't both have the same name, as it causes all kinds of problems. Most notable problem for me is that I ...
0
votes
1answer
45 views

name of probability + (pseudo)random functions

What is a group/family of functions that is random but some number(s) are more likely to come? For example, calling each of this fake functions 10 times give: random2: 2,3,2,4,2,6,7,2,2,2 random4: 4,...
2
votes
2answers
92 views

When should the naming of data structures be more abstract or literal?

Say that I create an ordered set structure, and I choose to implement it as a binary tree. I name my structure OrderedSet because I feel its underlying implementation isn’t necessarily important to ...
4
votes
2answers
203 views

Common loop variable names for indexes in 4D and above

I am curious if there are common loop index variables (of single character or not) for dealing with 4 dimensions and above? I was helping another student working through CS50x who was just learning ...
2
votes
1answer
142 views

Term for the opposite of the functional Compose operator

In functional programming, given a function f and a function g we can define a function . (compose): let (.) f g = fun x -> g (f x) Is there a term for the function which applies arguments in the ...
4
votes
2answers
236 views

Name for a Chainable ForEach [closed]

Linq has a method Select, which takes a Func<TIn, TOut> and maps it over an iterable. I'm trying to come up with a good name for a method that takes an Action <TIn>, transforms it to ...
2
votes
1answer
76 views

Phrase for “timestamp”-like value that increments every time there is a state change?

Is there a phrase in common use for a counter that is incremented every time the state of an object changes? It's not quite a timestamp and it's not quite a revision but maybe there is a common name ...
0
votes
2answers
171 views

Is there a name for “leak” of CPU usage? [closed]

A counterpart to memory leak, but involving CPU time instead - the program's CPU usage slowly climbing to 100% and then the whole system slowing down - without memory footprint changing. An example ...
3
votes
2answers
1k views

What do we call “IP” and “port”?

When I'm looping through files and coming up with dynamically created Ansible playbooks and stuff like that, I've quite frequently had to work with a single variable that contains the IP and port of ...
2
votes
1answer
867 views

Best practices for scientific variable naming?

What are some of the conventions you use when naming variables in mathematical/scientific code? I'm looking to establish a set of conventions for an upcoming project. So here's an example formula to ...
-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 ...
7
votes
1answer
2k views

Why would you want different identifiers for a typedef and its associated struct tag?

Ignoring (with difficulty) Occam's Razor which would seem to put this quickly to rest, what advantage would this have: typedef struct s_header { struct s_header *next; //... } Header; over ...
5
votes
3answers
474 views

“Smart create” method naming

Every class of a model in my application has a create method. The framework gives me the default implementation of create which is “create in the DB”. Sometimes I need to perform some extra actions ...
2
votes
1answer
612 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 ...
1
vote
2answers
189 views

How are non-folder files called? [closed]

Maybe it looks like a weird question, but what term should be attributed inside the code for files that are not folders to differentiate them from folders? If I need write 2 functions isFolder() and ...
9
votes
3answers
17k views

How to deal with Classes having the same name (different packages)

Me and my R&D team maintain a large codebase. We've divided our business logic into multiple packages. some of which have classes with identical names. As you can guess, the names conflict when ...
10
votes
5answers
768 views

How to refer to ByRef and ByVal in a dropdown label? [closed]

The MSDN page on ByRef and ByVal keywords isn't very helpful; unless I somehow skipped it, they're simply being referred to as "keywords" everywhere. One of the main contributors of the Rubberduck ...
0
votes
1answer
225 views

Super classes that represent a wordly hierarchy: naming conventions [closed]

I'm unsure whether this post is allowed, considering it may be subjective. However, I have seen many posts concerning naming conventions (on programmers, as well as on StackOverflow - where I'm a more ...
3
votes
1answer
708 views

Why do you reduce multiple inheritance to the diamond problem?

Whenever I read something like this: Many programmers exhibit a slight, involuntary shudder whenever multiple inheritance is mentioned. Ask them to identify the source of their unease and they ...
5
votes
4answers
913 views

How narrow or broad should constant names be?

I always seem to come back to this question and cannot settle on a convention that I'm comfortable with or that I can concretely define: when naming a constant, how narrowly or broadly should it be ...
-1
votes
1answer
102 views

How to abbreviate “Local” for a time variable, like UTC [closed]

In a database I work on, most of the datetimes I store are converted to and from UTC so all of my datetime columns end in UTC such as CanceledUTC. I have a situation where I need to store a "local" ...
11
votes
1answer
4k 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 ...