Questions tagged [naming-standards]

The tag has no usage guidance.

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

When Intel / AMD choose their Nanometer Processes, why were the specific numbers, 5, 7, 10, 14, 22, 32, 45, etc chosen? [migrated]

When looking at the roadmaps for the CPU manufacturing process https://wccftech.com/intel-expects-launch-10nm-2017/ 10 µm – 1971 6 µm – 1974 3 µm – 1977 1.5 µm – 1981 1 µm – 1984 800 nm – 1987 600 nm ...
-3
votes
2answers
94 views

Naming conventions for set/unset method parameter

I have some class MyClass which has two methods: Lock(){} Unlock(){} For some reasons, the two methods are to be unified into one, with an additional parameter for indicating the action. What should ...
0
votes
1answer
100 views

How to avoid messy code when working with different libraries

I'm planning to work with different libraries that use different conventions. One uses snake_case, another one uses camelCase. This leads to code that looks like I can't make up my mind: Some_Result ...
0
votes
6answers
158 views

Naming boolean fields in classes

I have had hard times naming boolean fields. On the one hand, i've read that it is good to name them as affirmative statements, like hasAge, or canDance. It's not a problem when naming local ...
-4
votes
3answers
78 views

Should I prefix keys of JS object with the object's name?

Let's get to an example. Suppose, I have a Course object with the following properties: (course' code, course's title, credit of course etc.). When expressing this as a JS object, I can do it in the ...
1
vote
2answers
99 views

How to name two versions of the same object, where one has a smaller amount of data and one is the “complete” object

What is the best way to name two classes that describe the same object, but where one of those classes does not hold the complete information? And should I make one of the classes inherit from the ...
4
votes
2answers
243 views

When to use third-person verb? (PlayOnAwake or PlaysOnAwake)

First a couple of examples: var val = obj.GetValue(); var can = obj.CanPlay; var has = obj.HasValue; var val = obj.RequiresConstantRepaint(); // From Unity var val = obj.PlayOnAwake; // From Unity ...
23
votes
3answers
6k views

Why are module-specific prefixes widely used for function names in C modules?

In some C projects, function names start with a common prefix indicative of the module name, for example: mymodule_do_this_stuff(); mymodule_do_that_stuff(); Is there a justification for doing so ...
2
votes
3answers
185 views

Use prepositions in naming verb-phrase functions?

When writing a library, designing a class or extending some existing API, we often need to express actions or relations involving noun entities: "Place the ball in the bin" "Obtain the coat for the ...
-2
votes
2answers
115 views

Python function name convention for “convert foo to bar”, e.g., foo_to_bar, foo2bar

I have a function that converts args given by argparse to a filename: def args2filename(args, prefix): filename = prefix kwargs = vars(args) for key, value in sorted(kwargs.items()): ...
1
vote
3answers
219 views

Should I give an object that holds multiple objects of the same type a plural name?

I have an object: const riders = { Dave: { gender: 'male', age: 13, }, Nina: { gender: 'female', age: 16, }, Mike: { gender: 'male', ...
2
votes
2answers
60 views

API naming for authentication API composed by many steps

I have an API which include a registration and login process. Both process have an authentication sub-process. This sub-process are many steps which API validate a client specific data. I have many ...
0
votes
3answers
269 views

How to name functions with multiple return values

In many languages, it is common for a function to have multiple return values (as a tuple), such as: def foo(): return "Hello, World!", 0 I often do this when a computationally expensive (or an ...
1
vote
3answers
225 views

How should I name output variables that are the same as the function?

What are some conventions for naming a variable in cases where the name of the variable ought to be identical to the name of the function? I'm using VB.Net. I often have this problem when writing ...
2
votes
1answer
96 views

Naming a software which allows communication between two independend systems via internet [closed]

Probably a trivial question but I just don't know how that piece of software would be called correctly: I have a closed system (A) and an application on another system and location (B). The ...
1
vote
2answers
63 views

naming the classes for users of my app, and users who manage the app

Naming things is hard but naming them properly is really hard. We are working on an app, that analyzes the data of multiple apps and creates some reports. And we are hitting our heads against walls ...
-1
votes
2answers
120 views

Common way to name methods with same name as desired variable? [closed]

I frequently find myself pulling up helper methods in order to make my code better, but end up with duplicate method names. Is there a standard way to name such methods without getting duplicate names?...
0
votes
2answers
631 views

Booleans Naming conventions : How to prefix a “show” boolean? [closed]

I've seen here that it was a dividing topic to use "should" as a prefix for a boolean because it could mean that we're unsure. Then how would you prefix a boolean such as "myButton.shouldShow"? I ...
1
vote
1answer
62 views

Need help with naming substate

I'm designing an application which accepts a command, processes it and produces a result. Application will maintain the status of the input command as 'new', 'processing' and 'completed' as it ...
1
vote
1answer
75 views

What should I call a flag to maybe disable some behaviour? [closed]

Say I have a function: def foo(x): if x % 2: do_something_with(x) return x And I want to make the doing of something opt-outable: def foo(x, maybe_do_something_with_x=True): if ...
2
votes
1answer
372 views

Naming Convention [closed]

When we determine names for the variables, there are two important issues that the people mention: The variable names must be explanatory. For the sake of this, their names can be long.` The variable ...
2
votes
4answers
812 views

C# class naming convention for a single item in the item list [closed]

In my C# project, I have a domain class named 'User'. this class will contain user's id, firstname, last name, DoB, home address, phone, etc. And we also have a typical REST web api (i.e. api/users) ...
1
vote
2answers
548 views

Using “On” at the start of a method name

From what I've observed, methods that start with the word "On" fall into two categories: A base class that defines an event will expose a protected method whose name starts with "On" followed by the ...
0
votes
1answer
66 views

Variable naming for collaboration between software engineering and data science

There exist lots of discussions on variable naming. However, I would like to address a specific aspect. I am a data scientist and deal with dozens of features/variables/columns — however you may call ...
3
votes
1answer
224 views

Application_Start() vs ApplicationStart()

Why is the method in Global.asax called Application_Start() and not ApplicationStart()? According to MSDN method names should be in Pascal case.
2
votes
1answer
53 views

Does any scale exist (e.g. naming convention to be used for sizes) that allows trivial insertions at any point in the scale?

Question probably sounds confusing so let me clarify. Let's say I have an object containing keys and values for my project's font sizes: { small: '8px', medium: '11px', large: '14px', } ...
7
votes
4answers
1k views

Is it a good practice to end a function's name with a preposition?

I have seen examples of methods whose name ended with a preposition applying to the first (and most often only) parameters. But other examples don't use this kind of naming convention. Which do you ...
0
votes
2answers
202 views

Is there a rule of thumb when it comes to the “name” attribute?

Since there is things like BEM in naming conventions for HTML class attributes, does the name attribute have anything of that sort?
0
votes
1answer
84 views

What to specify as interfaces in component diagrams

I am following the textbook Object oriented software specification using UML, patterns and Java (3rd edition) and I am defining interfaces between system components (subsystems). But I encountered a ...
2
votes
1answer
814 views

Naming conventions for pure functions

Are there 'conventions' / best practices on naming pure functions? For example: adding numbers: add or sum? calculating the square root: calcSqrt or sqrt? reversing a list: reverse or reversed? ...
0
votes
3answers
214 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
votes
2answers
220 views

SQL Coding Naming convention: Variable same name as Columns

Is there a coding naming convention principal for SQL variables? Can variables be named the same as column names, I heard in different companies, this may cause confusion. However in C# below, its a ...
0
votes
1answer
83 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 ...
6
votes
1answer
321 views

Is it a good practice to redefine unavailable keywords as macros?

Is it a good practice to redefine unavailable keywords with macros? I use GCC 4.8 in one of my projects which isn't exactly C11 standard compatible. At least not the extent of 4.9. But there are some ...
3
votes
2answers
503 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
2answers
898 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(...
0
votes
1answer
182 views

Is a URC (Uniform Resource Citation) synonymous with a Query String or Url Parameters?

Reading this: https://renenyffenegger.ch/notes/development/web/URI-URL-URN-IRI-URC URCs provide a set of attribute/value pairs that describe properties of URIs like authorship, publisher, ...
-3
votes
3answers
167 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 ...
0
votes
3answers
470 views

RESTful APIs: Terminology for Update Modes/Types

When designing a RESTful API, providing a spec for updating an entity will force the designer to make some decisions on how the update will behave (an update mode or type). Here are some of the modes ...
-3
votes
2answers
429 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 ...
0
votes
1answer
2k 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 ...
2
votes
4answers
849 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 ...
-2
votes
1answer
73 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 ...
32
votes
2answers
9k views

Why does software use the Win32 name?

If a software/library has some support for the Windows platform they almost always name their directories and variables as win32. This is most prevalent in C/C++ projects. Even the MinGW project's ...
7
votes
2answers
3k views

What's the Java convention for names with a sequence of numbers, like “ISO 8859-1”?

If I'm creating a Java class for something that has a sequence of numbers in its name, e.g. “ISO 8859-1”, how should I name my class? Iso88591 seems wrong, since there's no boundary between the ...
1
vote
0answers
2k views

Entity Framework naming conventions for the same table name across multiple schemas

The DbContext of my application's Entity Framework setup (which I will refer to as ApplicationContext, the name of our derived type) contains classes for all of the tables in our SQL Server database, ...
6
votes
6answers
2k views

Use of “my” prefix in object naming

I am refactoring a large code base, and noticing the author often uses "my" to prefix object names. For instance, using myThingy to identify an object of type Thingy. Is this generally considered a ...
1
vote
2answers
65 views

What's the standard term for removing data and embedded code modules from a database before publishing?

Hopefully this question isn't too application-specific; I'm thinking about it with regard to Excel, but I think it applies to any file-based database that includes embedded code. I'm working on an ...
24
votes
8answers
19k views

C# - Why are prefixes on fields discouraged?

Back in the old days, we did Hungarian notation. That's now considered passé, and for the most part I don't use it anymore, but I still find use for the m_ prefix to indicate member fields. For me, ...
3
votes
1answer
108 views

Naming a view class

I'm a little hesitant on what to name a view class. I have a view class which I call ChooseImageView because that's what the user does in that view. After the user has chosen an image I display a ...