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
1 answer

Is there any documentation describing the naming convention of the stage names in a Jenkinsfile?

Is there any documentation describing the naming convention of the stage names in a Jenkinsfile? node('base') { stage('unit test (java) xxxx xxxx') { ...} } The stage like this (above) is quite long, and contains a bracket, just…
wawawa
  • 2,835
  • 6
  • 44
  • 105
3
votes
0 answers

Is there some convention on how to name in-place and non-in-place functions?

Are there best practices for function names in that case where an in-place and an out-of-place function exists and they can not be distinguished using the parameters? Example: Suppose I have a function to make a string uppercase: void…
Fabian
  • 4,001
  • 4
  • 28
  • 59
3
votes
5 answers

Naming small storage classes in java

i often have in java projects a lot of small helper("storage") classes like 2-Tuple, 3-Tuple, Point, .. (think you know what i mean) Classes that mostly only have class variables, a constructor and getters/setters. And in my current project, i…
Simon Lenz
  • 2,732
  • 5
  • 33
  • 39
3
votes
1 answer

Laravel best naming convention for controller method and route

I'm creating an ajax request to get item details Here's what my controller method looks like. class SystemItemsController extends Controller { function getDetails(Request $request){ $response = SystemItems::where('item_name', 'like',…
rjmcb
  • 3,595
  • 9
  • 32
  • 46
3
votes
8 answers

Why is it bad to start a variable name with a dollar sign in C++/Java and similar?

Why is it bad to start a variable name with a dollar sign in C++/Java and similar such as in PHP? Edit: Are there any risks?
Johanna
  • 31
  • 1
  • 2
3
votes
8 answers

Can Method names start with Get in .NET

I came across a recent Audit report in our company for the code we maintain which says that we should not use Get in the method (not properties) naming like in GetSearchResults or GetXyzInformation. I looked up the MS guidelines…
Dinesh Manne
  • 1,824
  • 6
  • 25
  • 32
3
votes
3 answers

How do you name your query string variables? Short or long? Why?

In our code we have query string variables with very short names such as cId, iId, isA and u. It is very hard to tell what this variables are from their names. I want to use more descriptive names such as customerId, itemId, isAnonymous and user. I…
CleanCoder
  • 807
  • 1
  • 9
  • 19
3
votes
1 answer

Class Naming Conventions with Layered Architecture and Entity Framework

I'm designing a layered architecture (Service/Business Logic Layer, Data Access Layer) and am struggling with the intersection of a few problems. Entity Framework 4.1 does not support interfaces directly My Interfaces contain collections of other…
3
votes
2 answers

Zend Framework: Action controller naming rules

I am unclear on the naming rules for Actions using stadard routing, etc, in the Zend Framework. Am I limited to using lowercase letters only? And if so, how do other developers deal with the lack of flexibility? The Standard Naming Conventions in…
DatsunBing
  • 8,684
  • 17
  • 87
  • 172
3
votes
1 answer

Should units of measurement always be included in all the variable names?

I've seen some differing views on whether or not you should include the units of measurements in variables and I'm not quite sure how to deal with corner cases. For example if I had a variable that stored the "acceleration" obtained from an…
Belphegor
  • 1,683
  • 4
  • 23
  • 44
3
votes
2 answers

Lisp %var naming convention

In the https://www.cliki.net/Naming+conventions page i read low-level, fast, dangerous function, or Lisp system specific implementation of foo Can someone translate this into again with perhaps an example of those contexts?
user4813927
3
votes
1 answer

How to name subclasses?

Good morning, I will be having many subclasses, subclasses of subclasses, and so on. How to name them properly in order to avoid a mess in naming and make them consistent? I mean, I could do this: Animal -> LargeAnimal -> LargeAnimalFromMeat Animal…
user7489400
3
votes
3 answers

Can cocoa framework hide an ivar declaration in their public header file?

Is this possible ? My colleague told me that naming a ivar with prefix underscore like what apple mostly does may cause some problem. He said that apple can declare an ivar in a class and doesn't let it be in the public header file. So if i…
Jimmy
  • 1,094
  • 10
  • 22
3
votes
1 answer

How should I avoid naming collisions with included libraries in C?

I had an enum TokenType defined in one of the header files in my project. When I later included to some header, the compiler complained it already defines its own TokenType. What is the convention in C to avoid such naming collisions?…
Aviv Cohn
  • 15,543
  • 25
  • 68
  • 131
3
votes
2 answers

Why is STL "empty" member function not called "isEmpty"?

Kindly check std::vector from cplusplus.com. It says it has an empty() member function: empty Test whether vector is empty (public member function ) http://www.cplusplus.com/reference/vector/vector/empty/ Signature : bool empty() const; To me,…
MAG
  • 2,841
  • 6
  • 27
  • 47