Stack Exchange Network

Stack Exchange network consists of 174 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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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
2answers
226 views

Is it necessary for a boolean to be “false” by default?

For example, to store whether sound is on, I have a boolean originally named "isSoundOn": private boolean isSoundOn=true; however, the default value of boolean is false, but I want my application to ...
0
votes
2answers
45 views

Should the key of locale text contain the actual context, or the meta information about it?

For example, suppose my app have some localized text, my question is , should the key contain actual context of text: { "WELCOME_TO_USE_THIS_APP":{ "en":"Welcome to use this app,...", ...
0
votes
2answers
57 views

Convention for labelling coordinate axes in 3d graphics

When I recently started doing some 3d graphics, I carefully (tried to be careful, anyway) decided to use the conventional mathematical standard for labelling axes, which was much more convenient for "...
0
votes
3answers
104 views

Should the name in the codebase always match how users refer to it? (example inside)

We have an internal tool where our account management teams can say "whenever we send this type of SMS message, use this text I specify instead of the default text". They would call this 'configuring ...
0
votes
3answers
180 views

Naming variable which describes that something is currenty in use

I'm creating a variable which should describe that an object is currently in use. Lets say we have a form with a password input, and I want to describe the state when someone is using that input. Is ...
1
vote
0answers
47 views

Is this a misuse of locales (internal config name)?

I have a situation where a given object is named, but there are multiple formats that are reasonable for that name. internal: fully qualified human-readable: translatable name, meant to be used in ...
0
votes
1answer
35 views

How to name Groovy Traits?

Classes should be nouns and methods should be verbs. What about Groovy traits? Should they also be nouns? Or maybe should they be adjectives / ability words?
6
votes
3answers
300 views

Equal length variable names: tricks or alternatives? [closed]

This might be a super nerdy, OCD-like, silly question, but... I love it when related variables have names of equal length, such that when written below one another, it lines up nicely. Eg: min/max: ...
-1
votes
1answer
58 views

What's the difference between “foo.spec.ts” and “foo.test.ts"?

When I use Angular CLI to generate a component, the test linked uses the logic foo.spec.ts. I am reading a tutorial where the test linked uses the logic foo.test.ts. What's the difference between “...
6
votes
1answer
343 views

Is method with “ByXXX” suffix (eg:findUserById) redundant?

Sometimes I can see method definition like: public User findUserById(int id){ } But my justification is, isn't "(int id)" already include the information of "ById"? is it better to have naming just ...
-1
votes
4answers
90 views

Sending camelCase code to under_score code

I'm working with JavaScript and PHP right now. My JavaScript uses camelCase while my PHP uses under_score for variable/object/array naming. I often have JavaScript send data to PHP. In fact it's ...
0
votes
1answer
74 views

Co-ordination between technologies following different naming conventions [duplicate]

Javascript community generally follows camel case naming convention, whereas while writing REST api URLs follow snake case naming conventions. What would be the better naming convention for the ...
0
votes
3answers
318 views

Best way to naming classes and packages in Java

Apart of the code conventions to use camelCase, PascalCase etc., are there any conventions for naming packages and classes in Java? For example, I have an mvc project and the main package is com....
2
votes
1answer
258 views

How to name a Boolean variable that represents either of two options?

I'm developing an application with Python. I want to have a Boolean variable that represent whether something is buy or sell but I'm not sure how I should name it. Here are my current ideas: isBuy ...
3
votes
4answers
255 views

Method naming with an out parameter

What naming convention should use when I have a method with an out parameter. I want to do this using clean code principles. So is it a good practice to include the name of the out parameter in the ...
-3
votes
3answers
65 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 ...
0
votes
2answers
96 views

Name of a class representing a 3d model

How would you name a class describing a 3d model? 3DModel, this is not a valid identifier ThreeDimensionalModel I do not like this Model to general AnimatedMesh to technical or close to ...
-2
votes
1answer
85 views

For use once only functions extracted from a longer function, should the name be xxx1(),xxx2,… or relate to there task?

According to Is it OK to split long functions and methods into smaller ones even though they won't be called by anything else?, I can split long functions into smaller functions even if they are ...
2
votes
1answer
98 views

For a use once only button callback, should the name be more related to the button or the task of the callback?

Suppose I have UI like it: <script> var someFunction(){ //some code to validate and then send message } </script> Message:<br> <textarea></textarea><br> &...
2
votes
1answer
188 views

Method naming: to vs as vs get

Do the words to, as and get have any special meaning when used in method names? Examples to new Integer(4).toString() get Integer.getInteger("system.unknown.property",4) as Arrays.asList(...
5
votes
2answers
357 views

C# Names of Namespaces with version suffix

In official Microsoft docs: ✓ DO use a stable, version-independent product name at the second level of a namespace name. But in Reference Source, the following namespaces ends with Version: ...
0
votes
1answer
52 views

What's the correct word to refer to domain-specific entities?

I've been incorrectly referring to domain entities as DSL, and I want to know what's the correct word for it. Let me give you an example: In the system I'm working on, we have entities similar to a ...
1
vote
1answer
105 views

Naming standards or conventions for ecommerce

Naming things There are only two hard things in Computer Science: cache invalidation and naming things. -- Phil Karlton Naming things seems so trivial, before I read this quote, I would have ...
4
votes
3answers
208 views

Is there a name for iterating between refactoring and feature development?

I'm working on a personal project and I've found myself switching between doing some refactoring for a day or two and then some feature-adding for a few days. I like it, and I noted it was similar to ...
1
vote
1answer
264 views

Naming a Domain Model project

This question follows on from my other question here: How does an isolated class (or group of isolated classes) fit into a Domain Model? I have looked at a few domain models online: https://github....
1
vote
1answer
111 views

What alternative name to give to controllers?

There are several posts and other contents in the internet that claims against naming classes ending with "er" (like manager, controller, helper...). I personally agree with that, but what ...
-3
votes
3answers
159 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 ...
5
votes
2answers
182 views

How should I name the fields in a class representing 2D and 3D sizes?

I'm working on a display library which in most cases works on a 2D plane but it has some components which display 2D projections of a 3D space. This domain has the notion of Position, Size, ...
3
votes
1answer
110 views

Should I avoid creating a variable with shorter name for a constant?

suppose I have code like this someFunction:function(userId){ var url=SomeClass.SomeNetworkConnector.SOME_URL; if(url !== undefined && userId !== undefined){ this.openURL(url+"?userid="...
7
votes
6answers
642 views

How to name a method which may or may not perform an action depending on a condition?

I stumble across this case somewhat often, and I'm surprised about finding so few similar discussions around the web. This question is very related, but my problem is that I want a method that does ...
3
votes
1answer
169 views

How to name two functions that could be named the same?

I have a node app with a queue for processing jobs in the background. I have a file that exports a function which when run, creates a job in my queue. In that file, I also have the handler for this ...
1
vote
1answer
301 views

What are TDD and integration test naming conventions?

I am building a small web API using .NET Core. I want to practice TDD and this is my first attempt at TDD. These are a few use cases of the API: Users in administrator role can create/edit/delete ...
1
vote
1answer
148 views

What do you call a process that will not complete? [closed]

As we know, some processes will complete. void func (var a) { Console.WriteLine(a) }; And some will not, void func (var a) { while (true) { Console.WriteLine(a) } }; What do we call the function ...
0
votes
0answers
73 views

Why is overloading called overloading? [duplicate]

I have problems with the term "method overloading". I know that overloading is the ability to create multiple methods of the same name with different implementations. My problem is however, that the ...
0
votes
1answer
83 views

Should the name of a new state variable reflect the original setter context or the intended usage?

I often face this problem when new requirements come along, but have never seen it discussed anywhere. In this case, I have an existing list of items (staves in a musical score). The requirement is ...
2
votes
2answers
75 views

Naming a contradictory wrapper

I have written a Monix Consumer that wraps a Kafka Producer and am at a loss about what to name the result. KafkaConsumer is already a class, which has essentially the opposite meaning which the ...
3
votes
1answer
124 views

Building a solid vocabulary when working in a specific domain

This question might be a bit vague and answers might come up quite opinionated but I don't know how to rephrase it so here it goes. How can a developer build a solid vocabulary when working in a ...
-3
votes
2answers
334 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 ...
-2
votes
1answer
516 views

How to name different components in adapter pattern?

(example code in PHP, but this can apply to more languages) I have a scenario with an adapter pattern, where I have classes, interfaces and objects with different roles, like so: An original object ...
3
votes
2answers
334 views

Avoiding conflicting namespace and class name

Say I am developing a Calculator application. It has one class called: Calculator. Therefore my namespace structure would look like this: MyCompany.Calculator.Core.Calculator Unfortunately, this ...
2
votes
1answer
112 views

Is it Pythonic to have a module named `functions`?

I have a Django project. All the apps are separated nicely. Each apps often have functions that are used across the apps. Currently I place them in module named wrappers (for wrapping django/built-in/...
2
votes
4answers
490 views

Naming similar variables [closed]

I need few related variables (for example I have the lengths of 3 lines given. I have to say whether they form a triangle). Which variable naming convention is preferable in Java? len0, len1, len2 ...
-3
votes
1answer
67 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 ...
0
votes
1answer
90 views

What is the name or description of my technique for filtering items in array? [closed]

I've tried posting this question on StackOverflow but they told me to try it here since it's not so specific. I'd like to know the name of the algorithm or technique of following implementation. I ...
-1
votes
1answer
418 views

Tender Type vs Payment Method/Type

I'm designing the data model of a payment database. One of the domain requirement is to keep track of how the customer paid and, if applicable, what was used i.e.: Visa, Amex, etc. In the past I ...
2
votes
2answers
204 views

Giving multiple classes in a single library the same name

The project that raised this question is in C#, but it could apply to most languages that use namespaces. I've read many things on good naming practices: "Don't prefix your class names with their ...
-4
votes
1answer
104 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 ...
-2
votes
3answers
95 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 ...
1
vote
2answers
155 views

Naming functions that do one or more things

I recently picked up 'Clean Code' by Robert Martin and have taken to refactoring my recent project. I'm realizing how important it is to name variables and functions in a way that clearly expresses ...
1
vote
3answers
349 views

Is Diff a well understood term, or should I name it Differentiate?

I have a class which checks for differences. I could call this class ViolationDiffer public IEnumerable<ViolationChange> Diff( IEnumerable<Violation> old, IEnumerable&...