Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #13769
| From | Jan Burse <janburse@fastmail.fm> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: terminology |
| Date | 2012-04-22 00:55 +0200 |
| Organization | albasani.net |
| Message-ID | <jmvdt9$s4e$1@news.albasani.net> (permalink) |
| References | <terminology-20120420003700@ram.dialup.fu-berlin.de> <verb-20120422003824@ram.dialup.fu-berlin.de> |
Stefan Ram schrieb:
> I just found some support here:
>
> »LINGUISTIC METAPHORS IN SOFTWARE DESIGN«
>
> (...)
>
> »Messages resemble sentences
> Method names resemble verb and noun phrases«
>
> http://www.educery.com/papers/rhetoric/road/
>
> (But the second observation makes me think about
> using »word« instead of »verb«.)
Word is probably to general. For example a
number 123 is also a word. But it will never
occur in a method name position.
That "Method names resemble verb and noun phrases"
is a kind of a praxis in building method names
that are not only verbs, but that also indicate
the arguments of the verbs:
So instead of having a method declaration:
checking(String business, String number)
One sees:
checkingAccount(String business, String number)
But I would even prefer:
checkingByBusinessAndNumber(String business, String number)
Thus the best long method names are actually:
verb +
{ preposition +
noun }
The preposition+noun pairs should be given in the same
order as the method arguments appear in their declaration.
conjunctions can be used shorten the long method names.
But some hard core oponents would say not enough OO-fication
has been applied. Namely no class Account has be defined.
If there were a class Account one could simply declare:
static void checking(Account a)
Or even do it more OO-ish:
class Account {
void checking();
}
And everything would be clear. Right?
Bye
Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread
Re: terminology Jan Burse <janburse@fastmail.fm> - 2012-04-22 00:55 +0200 Re: terminology Jan Burse <janburse@fastmail.fm> - 2012-04-22 01:06 +0200
csiph-web