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.

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.

Examples

4026 questions
3
votes
4 answers

What's the meaning and use of "res" in function arguments?

here's a short question that my googling failed to deliver any clues on. It seems to be pretty commonplace to use the word "res" for one of the indexes in function arguments. Its existence appears to be agnostic to whatever programming language you…
3
votes
1 answer

Many to many naming conventions

What I've understand so far is that many to many table naming conventions for Laravel are: users & privileges = user_privilege But what is the case with more complex names like: attributes & composed_attributes = ? As you can see there is a…
Jocky Doe
  • 2,041
  • 4
  • 17
  • 28
3
votes
1 answer

Java method naming conventions

I have a boolean field called showLabels in a Bean class, and I want to provide getter and setter methods for it. The setter will be setShowLabels, but should the getter be isShowingLabels, isShowLabels (that's really weird sounding), or…
Peter C
  • 6,219
  • 1
  • 25
  • 37
3
votes
2 answers

Bash: illegal variable name error

I am trying to extract a field from a text file using grep. I want to store the line number into a bash variable for later, but I am getting an illegal variable name error. This is part of my script: #!/bin/csh set echo grep -n -m 1 "HR${4}"…
Jeff
  • 695
  • 1
  • 8
  • 19
3
votes
2 answers

A type with "Manager" in the name - candidate for refactoring?

I found a thesis on forums: If you have a type with "Manager" in the name, it's a candidate for refactoring. One answer: I know it's considered a code "smell" So... Why? Is this thesis correct? There are many managers out there. For example,…
topright gamedev
  • 2,617
  • 7
  • 35
  • 53
3
votes
2 answers

Go Naming convention for function

In documentation, they use camel case and pascal case both. Is this convention different for functions and methods? Does it decide scope of a function ?
surbhi
  • 387
  • 5
  • 16
3
votes
1 answer

Naming conventions for Python scripts without classes

I've searched around for an answer specific to my use case, but can't find one, so apologies if this specific case has been answered before. I run a number of isolated scripts which perform different functions, like assessing specific data from APIs…
3
votes
1 answer

Java Spring MVC Folder / Naming Conventions

I'm trying to determine the best way to organize our Maven / Spring web applications and have been looking around to see examples. Unfortunately, they seem to conflict at certain points. How should the folders be organized in a Spring MVC webapp and…
Buns of Aluminum
  • 2,439
  • 3
  • 26
  • 44
3
votes
2 answers

Java reason for changing of package name case convention

Just before you say this is a duplicate, I saw the other questions already and I still wanted to post this. So I was reading Thinking in Java -Bruce Eckel and this passage is about the lowercase naming convention: In Java 1.0 and Java 1.1 the…
Daniel Cheung
  • 4,779
  • 1
  • 30
  • 63
3
votes
1 answer

Naming convention for join tables, in a many to many relationship, in Laravel

I have 3 tables. The first two tables are Groups and Accounts. An account can belong to many groups. A group can have many accounts. In other words it is a many to many relationship. Therefore I need a 3rd table, which is a join table What is the…
Yahya Uddin
  • 26,997
  • 35
  • 140
  • 231
3
votes
0 answers

Why is default naming convention for Activity and Layout, MainAcitivty.java and activity_main.xml?

After developing Android for a while, I kind of got used to for Activity class, we just name it Activity.java, while it's layout as activity_.xml, given the default Android Studio generated is this. However when was asked why…
Elye
  • 53,639
  • 54
  • 212
  • 474
3
votes
4 answers

Matlab- How does you name a new variable based on other variables' values?

Possible Duplicates: How to concatenate a number to a variable name in MATLAB? MATLAB: How can I use a variables value in another variables name? I want to name a variable using values of other variables given in a function. So, if I have values…
max
  • 39
  • 1
  • 1
  • 2
3
votes
2 answers

Why non-static final member variables are not required to follow the constant naming conventions?

I am using NetBeans IDE and before Java, I was a C++ programmer. From C++, what I learn is that constant variable names should contain only uppercase letters. I think most programming languages suggest that constant variables should only contain…
user5818995
3
votes
0 answers

Naming convention for auxiliary typescript classes in Angular

In angular2 style guide there is a section for naming files, where it is specified: Do follow a pattern that describes the symbol's feature then its type. The recommended pattern is feature.type.ts. Let's say we are writing trading platform. So in…
zmii
  • 4,123
  • 3
  • 40
  • 64
3
votes
0 answers

How to name a base class for create and edit functionality?

I have a UI application which contains a dialog allowing to edit/create an entity. However create/edit classes share much code. What's the best names you can suggest for the base class?
Buckstabue
  • 283
  • 1
  • 13
1 2 3
99
100