Questions tagged [naming-conventions]

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

Existing Questions about Naming Conventions

3872 questions
3
votes
2 answers

What name should I give these two classes which were split from one class?

I recently did a refactoring. Basically, we have a system that reads an XML file and does some operations on it and then updates it and writes it out. I've split this functionality into two classes A class which "controls" the XML and abstractly…
Earlz
  • 57,517
  • 89
  • 275
  • 484
3
votes
3 answers

A common name for size and location?

This might be a bit silly question since it's all about terms and naming, but I find it important for me to name my methods correctly. I'm creating a windows form and I need a method that sets buttons' and textboxes' sizes and locations (at…
Patrik Lippojoki
  • 1,523
  • 3
  • 17
  • 21
3
votes
5 answers

configuration filename convention

Is there a general naming conventions for configuration files for a simple python program? Thanks, Udi
Adam Matan
  • 107,447
  • 124
  • 346
  • 512
3
votes
2 answers

Call an instance variable when its name is same with the argument variable

I have this code: class Foo { int x = 12; public static void go(final int x) { System.out.println(x); } } The argument final x and the instance x have the same name. How would I refer to the instance variable x = 12 if I want to use it in…
daremkd
  • 7,554
  • 4
  • 34
  • 60
3
votes
2 answers

Property Naming Convention

Paging Gabor de Mooij or anybody else who have been more experienced with RedBeanPHP. The current naming convention we have is using underscores and although anybody can make a case of using Pascal/Camel casing I think what's important is…
Jojo
  • 625
  • 10
  • 24
3
votes
6 answers

Naming convention of foreign keys

When making relations between tables (in mysql), I have encountered a naming dilemma. For example, if I was creating a site where a project could be created by multiple users and also read by multiple users, to link a questions and user tables, I…
zenna
  • 8,540
  • 10
  • 67
  • 100
3
votes
5 answers

What is this high-order function called?

I'm in doubt what to call a high-order function that transforms a function so it uses an array instead of an argument-list. It's complicated to explain in words, so there's an example in JavaScript: sum = function(a,b){ return a+b; }; foo =…
MaiaVictor
  • 45,122
  • 42
  • 127
  • 254
3
votes
16 answers

Naming convention for a variable that works like a constant

I have a variable that I'm using like a constant (it will never change). I can't declare it as a constant because the value gets added at runtime. Would you capitalize the variable name to help yourself understand that data's meaning? Or would you…
Pup
  • 9,476
  • 6
  • 42
  • 61
3
votes
2 answers

Method name conventions for setters and getters

I want all my instance variables private and accessors/mutators in public methods. I am wondering if there is a naming convention that I should be aware of when building large classes, a convention both for readability among other developers, but…
johnbakers
  • 22,776
  • 20
  • 106
  • 230
3
votes
2 answers

How long can variable and function names actually be in Javascript?

Possible Duplicate: Maximum length of variable name in JavaScript While reading on a bit of JS, I thought to myself: how long can my names be? function myNormalFuncName () {//...} var myNormalVarName = 'how long?'; So my question is how…
jeroen
  • 482
  • 7
  • 16
3
votes
2 answers

actionscript 3 package naming conventions

What are the naming conventions for packages with names that contain more than one word? Lets say I have a package named 'garden hose', should I name it garden_hose, gardenHose or simply gardenhose? I know that packages are normally named with…
AturSams
  • 6,416
  • 14
  • 53
  • 91
3
votes
3 answers

Parameter naming convention in Python

For functions with closely related formal parameters, such as def add_two_numbers(n1, n2): return n1 + n2 def multiply_two_numbers(n1, n2): return n1 * n2 Is it a good idea to give the same names to the parameters in both functions, as…
Steven Maude
  • 828
  • 9
  • 21
3
votes
1 answer

Method naming convention in Scala -- mutable and not version?

This example is trivial just to show the point. Let's say I use matrix library, but is lacks some power, let's say doubling every element in matrix is so crucial for me, I decide to write a method doubleIt. However, I could write 2 versions of this…
greenoldman
  • 15,621
  • 22
  • 103
  • 174
3
votes
6 answers

is it ever useful to define a class method with a reference to self not called 'self' in Python?

I'm teaching myself Python and I see the following in Dive into Python section 5.3: By convention, the first argument of any Python class method (the reference to the current instance) is called self. This argument fills the role of the reserved…
Nathan Fellman
  • 108,984
  • 95
  • 246
  • 308
3
votes
1 answer

Naming convention for id and widgetvar in primefaces/jsf

I ran into an issue where i had the same id for both the id attribute and widgetvar, Apparently it is not recommended to have the same value for both attributes. so i am trying to find whats the best convention to follow. Are there special…
Gowtham
  • 1,207
  • 2
  • 15
  • 25
1 2 3
99
100