The naming tag has no wiki summary.
5
votes
1answer
111 views
Recommended Naming for function that tests and mutates
I am a huge proponent of self-documenting code (when at all possible). I prefer to have code be self evident by the very nature of the names of the variables, methods, etc.. For instance:
if ...
4
votes
5answers
233 views
Is this an acceptable method name?
GetCollectionWhereKeyStartsWith(string key)
The intent of the method is to retrieve a sub-collecteion from a name value collection where the key starts with the passes key argument.
-1
votes
2answers
89 views
What is a good name for bidirectional dictionary structure? [closed]
I'm writing a generic bidirectional dictionary which will be a part of a (somewhat) public API. This is how the dictionary works:
It will hold key-key pairs where key1 and key2 will be two different ...
0
votes
2answers
98 views
How to name this function?
The sample code is like this:
def a_func(parent_node, child_node):
parent_node.add(child_node)
// check validity
return child_node
node1 = a_func(pnode, Node(attr_x = "a new node")
node2 ...
0
votes
2answers
40 views
Best method name for name exist check [closed]
There is a method that checks if a name already exists :
bool Foo(string name) {
return Names.Contains(name)
}
What would be the best name for this method?
1
vote
0answers
51 views
Is there a common variable name prefix/suffix for shortened, or formatted, dates
We have code that looks like this:
start_date = Date.current.beginning_of_month
end_date = Date.current.end_of_month
start_date_s = start_date.strftime("%Y_%m")
end_date_s = ...
2
votes
2answers
104 views
Suggest name for the method
I have an Interpreter class that has a method named loop. This method takes two inputs, a java.io.Reader and a java.io.Writer. Until Reader provides input, it is read, evaluated, and printed to ...
2
votes
2answers
50 views
Naming of overloaded methods - singular or plural? [closed]
This question is about your opinions and/or existing conventions.
Let's say I have an object Basket that store various items in some private property (Basket._items). Now, I want to have a couple of ...
3
votes
1answer
219 views
Rails: Cleaning parameters before passing them to a model
I'm writing an API and want to be able to pass in the attributes of a model without prefixing them with the name of the model. I wrote this little extension to ActiveRecord in order to make it happen:
...
1
vote
2answers
97 views
FooTest or FooTests? [closed]
Can't make up my mind. For a class Foo, should its test class be called FooTest or FooTests?