method-names

What resources do you use to help you decide upon useful names for your classes and methods?

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. ...

Is there a particular naming convention for Java methods that throw exceptions?

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? ...

Use of special characters in function names

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...

Is there a technical difference between the terms "length" and "size" (in programming, of course)?

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. ...

Bad method names and what it says about code structure.

(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...

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 reason, he wants to hide the 'implementation details'. IMO implementation details are differen...

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 function that does this? ...

Ruby: what is the best way to find out method type in method_missing?

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. ...