With the exception of this site, what resources are out there that I don't know about for naming of things in your code?
We all know that a good name can really focus your understanding of something and aid communication within a team. How do you do it?
I'm not talking about naming conventions or what types of names are good or bad.
...
I'm tempted to add a suffix like "Ex" to differentiate methods (with similar signatures) that throw Exceptions from those that don't.
Is there such a convention?
...
In Ruby, a standard convention is to use a question mark at the end of a method name to indicate the method returns a boolean result:
[].empty? #=> true
Another standard convention is to end a method name with an exclamation point if the method is destructive (that is, it modifies the original data):
mylist.sort! # sort mylist in-p...
In Java in particular, on Strings, you call string.length(), whereas in Lists you call list.size(). Is there a technical difference between the two terms, seeing as a String is really just a list of chars?
Any comments appreciated.
...
(Apologies in advance if this is a re-post but I didn't find similar posts)
What bad method name patterns have you seen in code and what did it tell you about the code.
For instance, I keep seeing:
public void preform___X___IfNecessary(...);
I believe that this is bad because the operation X has an inversion of conditions. Note tha...
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 reason, he wants to hide the 'implementation details'.
IMO implementation details are differen...
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 function that does this?
...
At the moment I've got this code:
name, type = meth.to_s.match(/^(.+?)([=?]?)$/)[1..-1]
But it doesn't seem to be the best solution =\
Any ideas how to make it better?
Thanks.
...