Questions tagged [naming-conventions]

Do not use this tag to ask what you should name something. Naming conventions refer to general rules governing names assigned to programming constructs such as variables and methods. These conventions facilitate readability, and thus improved maintainability of code by enforcing naming consistency across disparate modules.

Filter by
Sorted by
Tagged with
0 votes
0 answers
28 views

What are the naming conventions for Firestore? [closed]

I am using Firebase Firestore. I have seen the naming constraints in Firestore, but I cannot find any naming conventions. What is the naming convention for these? Collection IDs Document IDs Field ...
Evorlor's user avatar
  • 7,321
0 votes
0 answers
16 views

Using BEM for large set design

I'm interested in how to solve the problem of names for classes. For example I have 30+ options for the first section (hero). They have different structure and different blocks inside. On the one hand ...
Никита Северин's user avatar
0 votes
1 answer
18 views

How to name 2 parameters for old and new entity state in an update/creation method?

Our (Java) project deals with multiple entities stored in a relational database. For example, we deal with persons. We have service methods (on singletons) which allow creation or modification of ...
Philippe Cloutier's user avatar
0 votes
1 answer
27 views

How do I name controllers which are related to multiple entities in REST?

I want to rename and re-route controllers to make them more "RESTful", and I encountered a problem. Let's say I have ItemsController, the route is api/items. Then I have VersionsController, ...
Jamil's user avatar
  • 830
0 votes
0 answers
21 views

What is best naming convention to distinguish between store and normal variable in svelte?

I am currently struggling with naming store(writable, readable etc) in svelte. store.ts export type CanvasContext = ReturnType<typeof createCanvasStore> export const createCanvasStore = () =>...
Eddie Jeong's user avatar
-1 votes
0 answers
25 views

What's the naming convention for constant local variables inside a function in Python? [duplicate]

I'm trying to understand how you should name a local variable that's inside a function that you DON'T want to be reassigned. Essentially, I want to indicate that the local variable is const. However, ...
Adrian D.'s user avatar
  • 512
0 votes
0 answers
24 views

Naming convention for the response model of an API

There is a REST API for which I have to describe to response model. It is a simple Get API, fetching different data from underlying systems. I am using camelCase There are a lot of self explanatory ...
G. Jonathan's user avatar
1 vote
2 answers
41 views

Django - confused about naming class and parameters (when to use uppercase / plural form)?

Such confusion reflects unclear understanding about class and framework. I'm learning database in Django models. I get confused about naming class. When to use uppercase / lowercase, when to use ...
ronzenith's user avatar
  • 373
0 votes
0 answers
70 views

Whatsapp media file name convert Android to IOS

If I have my WhatsApp database (msgstore.db) and I want to convert the names of the media files from the way they are called in Android for example IMG-20201026-WA0000.jpg To the way they are called ...
Aviv's user avatar
  • 3
0 votes
0 answers
23 views

Use typescript to restrict string literal type [duplicate]

I would like to use typescript to enforce a "t-shirt" naming convention. Can I for example create a typescript type TShirt which would work something like the following: const name: TShirt = ...
johann1301s's user avatar
0 votes
0 answers
18 views

Is this a reasonable way to "namespace" globals that my javascript scripts use to prevent collisions with other scripts

I'm a somewhat newish javascript programmer, who is easily surprised or overwhelmed by some of the nuances of the language, although I've been a programmer for over 50 years and used lots of languages ...
sootsnoot's user avatar
  • 2,178
1 vote
0 answers
44 views

Does naming properties with trailing double underscores have a meaning in C#?

The Thumbnail class of the YouTube v3 API has a member named Default__ member. Its name has a double trailing underscore __ at the end. Is this a naming convention? I haven't found any documentation ...
Amessihel's user avatar
  • 5,911
2 votes
0 answers
25 views

Naming variables with "my" to show they're not a part of a library?

I'm writing helper functions to simplify my use of an existing library. In this particular case, just for examples sake, I'm writing a helper function to get a doc from firestore. I've always named my ...
esafresa's user avatar
  • 510
0 votes
1 answer
37 views

Is there a reason for naming prefix Xl for Enum Classes in Microsoft Libraries?

The enum classes for all Microsoft libraries use the Xl prefix convention in c# Example: XlMousePointer XlColorIndex XlRgbColor Is there a reason for this? is this a Microsoft only convention?
Héctor José Hernández Reinoza's user avatar
0 votes
1 answer
71 views

Choose I use a suffix or prefix when naming variables?

Suppose I should have a foreground and a background image, each with their own variable for width, height, and bits per pixel. Should I define my variables as fg_width, fg_height, fg_bits_per_pixel, ...
Jeffery Tang's user avatar
0 votes
1 answer
55 views

What is naming convention for a file with Kotlin extensions?

I have generated class MyDto and I want to add couple of new functions fun MyDto.convert(foo: String): Bar {... I have no choice - I have to put it to different file but in contrast to java it won't ...
gstackoverflow's user avatar
0 votes
0 answers
37 views

Variable Naming Conventions in Programming

On a lot of occasion when looking at codes for embedded systems or linux kernels, I would come accross variables being named in a following manner: var_u16; For example suffix _u8 (unsigned 8-bit ...
Amaterastis's user avatar
0 votes
1 answer
31 views

Is there a good practice to name kotlin file contains only functions?

For example i have a kotlin file with validation functions. Another example is a file with only one function which gets mobile device data (manufacturer, android version, etc.) I have some thoughts to ...
Gayorgy's user avatar
0 votes
0 answers
43 views

Naming convention for a property accessor for a method "proxy"

Note, I'm using the word "proxy" in the general sense, to describe a class functioning as an interface to something else, I'm not using a "Proxy Design Pattern" or the RealProxy ...
Kyohei Kaneko's user avatar
0 votes
1 answer
31 views

Having issues with file naming

File name 'c:/Users/Mfoniso/Documents/CODE/NODE/meals-backend/src/models/mealModel.js' differs from already included file name 'c:/Users/Mfoniso/Documents/CODE/NODE/meals-backend/src/models/MealModel....
Mfoniso Ukpabio's user avatar
0 votes
1 answer
45 views

What is the rationale behind the naming of the squeeze and unsqueeze operations?

I was wondering if there is some (mathematical, historical, etc) reason behind the operations to remove and add singleton dimensions being called squeeze and unsqueeze. I am mainly asking from a torch ...
Kevin Spaghetti's user avatar
1 vote
1 answer
238 views

Naming variables in Ansible roles

In Ansible roles you can define variables in different ways: in vars/main.yml in defaults/main.yml via register in a task via a set_fact task in task vars probably more... Through this answer I came ...
stackprotector's user avatar
0 votes
1 answer
166 views

In Visual Studio 2022, how to make auto complete private field as camel case like _fieldName

I have custom naming C# use CamelCase with added underscore in front like fieldName become _fieldName. But the problem is the autocomplete always use fieldName not generate _fieldName. I already edit ...
Restu's user avatar
  • 11
0 votes
2 answers
375 views

ReactJS component file name must start with uppercase letter

I am playing around with the ReactJS and i have noticed that name of file which export components always upper case. For example file that contain Book component ( i'm working with book list) name ...
LeoPkm2-1's user avatar
2 votes
0 answers
68 views

Why ProblemDetails class has additional 's' in its name? [closed]

We have a debate about whether it is appropriate to have s or plural names in a class name. So as a guidance we took a look at ProblemDetails class which has additional s. According to this msdn docs ...
Learner's user avatar
  • 21
0 votes
0 answers
55 views

How can I name Classes using Snake Casing?

While coding in Java, I prefer to use pascal case for my class names and camel case for objects. For example: TextView textView1, textView2; But in C++, I prefer to use snake casing to name my ...
Elon Tusk's user avatar
  • 121
0 votes
1 answer
38 views

Naming variables which represent json

I am naming a variable JsonArray versionsJA = jsonObject.get("versions").getAsJsonArray() Is there any proper naming convention that can be done here? I mean something better than the name ...
nick's user avatar
  • 107
-1 votes
2 answers
81 views

What are the common ways to distinguish between identifier of local variables and global variables?

I write a function with using same identifier for local variable and globel variable, as shown as following codes: def func(time_len, num_nodes): pass if __name__ == '__main__': time_len, ...
theabc50111's user avatar
3 votes
2 answers
458 views

Python naming guidelines for putting numbers in variable names

I've been doing Leetcode problems in Python and I sometimes use numbers in my variable names for convenience, for example, acc1 or temp2. I use these for algorithms that require keeping track of more ...
agctute's user avatar
  • 123
0 votes
0 answers
31 views

Using "match" as a method name in Python class [duplicate]

I have a Python class Shape, which can perform matching. I called the corresponding method match: class Shape: ... def match(self, image): and it is working, as far as I can tell. Is there a ...
Paul Jurczak's user avatar
  • 7,042
0 votes
1 answer
118 views

ESLint plugin or rule for preventing generic variable names?

I've been searching for an eslint plugin that gives errors on generic variable/parameter/function names. I only find rather tedious answers (listing every possible symbol without pattern matching) or ...
Kimball Robinson's user avatar
0 votes
1 answer
33 views

How can I change the ranking of a file in the Quick Open search results listing?

I am following the Airbnb naming convention https://airbnb.io/javascript/react/#naming Thus, I am using the index.tsx file to define my custom React Component but, I have an issue when searching for ...
Hazem Alabiad's user avatar
0 votes
1 answer
319 views

Naming convention of event components in Service Bus Topic Trigger Azure Function

I am working with Azure Functions, In my application we are using Http Trigger Azure Function to receive the notification events(i.e. UserCreatedEvent, UserDetailsUpdatedEvent etc.) and after this ...
Rakesh Kumar's user avatar
  • 2,731
4 votes
1 answer
156 views

Order of words in multiple-word variables (and identifiers in general) [closed]

This is a question about variable naming (or naming of identifiers in general). Head-initial (right-branching) languages tend to have postnominal modifiers, while head-final (left-branching) languages ...
Lover of Structure's user avatar
0 votes
2 answers
131 views

Variable with same name as keyword

Is there a good way to create a variable, function, class, etc. with the same name as a keyword? What I usually see (and follow myself) is using slightly different names. For example, using clazz or ...
Zach Joseph's user avatar
1 vote
1 answer
175 views

Are there good naming conventions to get around long variable names, without having to rely on comments for better readability? [closed]

Basically I always try my best to avoid comments whenever possible. I watched many videos from Uncle Bob and regarding the things he wants to express, there are many things I agree to. He once ...
Bratko's user avatar
  • 19
0 votes
1 answer
104 views

Multi-word django model naming convention

I have a django model called ProfilePicture, i've renamed it from Profile_Picture to ProfilePicture so that it will fit python naming conventions. Right now, i am accessing it something like this ...
Grey Bunny's user avatar
0 votes
0 answers
164 views

WhatsApp pic - Naming Convention

I wish to understand the following regarding an image on an iPhone (indicated herein as forwarded to the specific iPhone). I have some questions: In respect of the information below, is it possible ...
Sansunita Minnaar's user avatar
0 votes
1 answer
563 views

Index pages in a react application and naming conventions with folder structure

I'm really trying to get an idea from other Javascript developers opinion on file name and structure. My main concern is using the file name index.tsx(or js) inside a lone folder if there would be ...
Micah Johnson's user avatar
0 votes
1 answer
48 views

Does the method name need to be grammatical? [closed]

I have a question that may seem silly, my english is not very good, I often don't know how to name variables or methods. For example, There is a method, its function is to open a modal for creating ...
undefined's user avatar
0 votes
1 answer
184 views

C# formatting with .editorconfig: can I use a different naming style for unit tests?

Is there a way to specify in an .editorconfig file that I want to use a different naming style for my Unit tests? Currently we're using something like this: GetAll_GivenNoCustomers_ReturnsEmptyList ...
Thomas Mulder's user avatar
0 votes
1 answer
259 views

Can kebab case have upper case letters as first letter?

Is there a strict definition for kabab case naming convention? Are uppercase letters allowed in kebab case? Does the following names follow kebab case? Article Article-Body
golopot's user avatar
  • 10.8k
0 votes
2 answers
442 views

Do the name of component in Reactjs have to be the same with file containing definition of the component?

I'm starting learning about reactjs. But when i watch tutorial on youtube i often see that when definite component in sperate file and export, people always name the file name with component name ...
LeoPkm2-1's user avatar
0 votes
0 answers
13 views

I am looking for explanation of the Naming convention of DM74LS138 decoder. I wanted to know what 74 signifies and what 138, LS signifies

I wanted to know the naming convention of the decoder as it will be easier to analyze, understand and remember the decoder better. I this information for a microprocessor I was working on.
Nikitha niki's user avatar
0 votes
1 answer
193 views

Is there a naming convention for custom repository response objects?

Probably some of you already met this problem. Sometimes you may want to execute a LINQ query which is returning custom data. That data is being encapsulated into a transfer object, but I'm a little ...
Ion cojocaru's user avatar
0 votes
1 answer
202 views

Naming conventions. Method or variable names containing numbers as a words

I can't find even couple of words about containing numbers in names of variables or on methods. Does anyone have any authoritative information about such cases: string2map its4me etc... Exactly using ...
user2625402's user avatar
0 votes
0 answers
115 views

Is there a naming convention for parent/child class methods in python?

I have the following two classes that operate on pandas Series objects. class Parent: def pre_process(self, series): # Do pre-processing class Child(Parent): def ...
codeananda's user avatar
3 votes
2 answers
162 views

What are the benefits of using `and` instead of `&&` when defining concepts? [duplicate]

I found that some CppCon speakers used and instead of && to define concepts and used && in "normal" boolean expressions, but I can't figure out the benefits of doing so. The ...
FeignClaims's user avatar
0 votes
0 answers
162 views

What is the naming convention for function parameters that accept the same data frame as input?

I have read the https://peps.python.org/pep-0008/ guideline for the naming conventions of python code. What I did not find is the convention for naming function parameters when there are multiple ...
Lord-Goku's user avatar
-1 votes
1 answer
61 views

Which case to use for JavaScript for naming variables? [closed]

I am using PHP Laravel and MySQL (which uses snake_case for field names) for API. Is it ok to use snake_case instead of camelCase for client side javascript so that it's easier to copy paste field ...
Asela's user avatar
  • 303

1
2 3 4 5
81