Questions tagged [method-names]
55 questions
0
votes
1 answer
Android - Navigation Bar - Left most triangle method name
By default the triangle is towards left and if i click on search option ,It opens up edit text on the top & virtual keyboard , the triangle changes its shape to downwards**,CLICK FOR IMAGE 1**Now when i tap on down triangle it only closes the…

Archit Gupta
- 1
- 2
0
votes
1 answer
Is there a specific name for this normalization function?
I want to write a normalization function that will take a signed integer and normalize it to a double between -1 to +1. Is there a special name for this type of function, or is Normalize() what people normally call it?
Also, is there a native iPhone…

Daniel T.
- 37,212
- 36
- 139
- 206
0
votes
3 answers
Should naming of methods within interfaces be concrete or abstract?
Often when I create new classes, I first create a new interface. I name the methods of my interface exactly as I would like them to behave. A colleague of mine prefers to have these method names being more abstract, ie: areConditionsMet(). The…

Stefan Hendriks
- 4,705
- 5
- 34
- 43
0
votes
1 answer
Why am I getting "onCreate(Bundle) already defined"?
I'm trying to produce several buttons which open different links but by copying the file over I get an error saying onCreate(Bundle) is already defined? Is it because I have two protected void onCreate(Bundle savedInstanceState) { or something?…

Dalton
- 19
- 1
- 7
0
votes
1 answer
Naming methods in Swift versus Objective-C
All:
In Objective-C, the name is constructed by concatenating the signature keywords, e.g., application:didFinishLaunchingWithOptions:
How do people refer to the equivalent method in Swift, when discussing it with other programmers (including…

Michael Rogers
- 1,318
- 9
- 22
0
votes
3 answers
Naming of a method that creates a list with new instances
There's a method that creates a list of new instances from some parameters. I would call it this way:
List createNewTypeInstances(OldType1 value1, OldType2 value2);
But I've also often seen it named in such a manner:
List…

Harold L. Brown
- 8,423
- 11
- 57
- 109
0
votes
1 answer
Are there any classes which can supply you with what a MethodInfo/method name would be?
I was wondering if there are any classes which can generate a MethodBase/MethodInfo, or simply generate the method name, without using "magic strings". Right now I'm doing the following:
public void Foo(MethodInfo method)
{
if…

myermian
- 31,823
- 24
- 123
- 215
0
votes
3 answers
Objective-C: Name of the method that adjust floating point value to 0-1
I created the following method to use rate safely.
(Sometimes rate can become invalid value like INFINITY, NAN, or out of 0-1)
-(double)XXXX:(double)rate
if (rate >= 1) {
return 1;
} else if (rate <= 0) {
return 0;
}…

js_
- 4,671
- 6
- 44
- 61
-1
votes
2 answers
How to name a method properly?
It's more a question about English grammar, but nevertheless, can you tell me which one is a correct method name? This ambiguity drives me crazy.
Method linesNumber returns number of "rows" in some sort of table.
I personally like "numberOfLines"…

yaru
- 1,260
- 1
- 13
- 29
-3
votes
1 answer
Looking for better method names
In a code review, I am facing a class that includes the following method pair:
getOrCreateXXXFor(YYY)
getXXXFor(YYY)
(XXX and YYY are two business logic types.) I'm not sure whether these are the ideal names.
The first is indeed related to the…

Jens Piegsa
- 7,399
- 5
- 58
- 106