Tagged Questions
2
votes
6answers
317 views
Naming functions that retrieve a value
I have this personal rule to start all function/method names with a verb. My verb of choice for functions or methods that get a value based on some data structure or object is get. I'm wondering if ...
0
votes
2answers
103 views
addIfNotExist alternative
Is there are any standards or conventions on naming methods which add something if it not exist into another something.
For example: Store.instance().addItemIfNotExist(item)
IfNotExist is really ...
12
votes
8answers
664 views
How and why to decide between naming methods with “get” and “find” prefixes
I always have trouble figuring out if I should name a certain method starting with getSomething versus findSomething.
The problem resides in creating helpers for poorly designed APIs. This usually ...
4
votes
2answers
357 views
Naming methods that do the same thing but return different types
Let's assume that I'm extending a graphical file chooser class (JFileChooser).
This class has methods which display the file chooser dialog and return a status signature in the form of an int: ...
3
votes
1answer
246 views
Better use on the name of variables
I have a method that looks like this:
Public Function NormalizeStreetAddress(country As Namespace.Country,
streetAddress As Namespace.StreetAddress) _
...
5
votes
5answers
273 views
Is it good or bad form to name a function after the workaround it fixes?
Lets say you have to write some code to fix a bug that on first glance by another engineer would seem weird or unnecessary.
Would it be good or bad form to put the code in a method named for example ...
1
vote
1answer
75 views
Contrary method subjects for identical method names
I've got method naming paralysis!
Say I've got one class - "System", and another class "User".
Now, if I want to notify user(s), I can call:
// this method can notify individuals and collections of ...