Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #13769 > unrolled thread
| Started by | Jan Burse <janburse@fastmail.fm> |
|---|---|
| First post | 2012-04-22 00:55 +0200 |
| Last post | 2012-04-22 01:06 +0200 |
| Articles | 2 — 1 participant |
Back to article view | Back to comp.lang.java.programmer
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
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
| From | Jan Burse <janburse@fastmail.fm> |
|---|---|
| Date | 2012-04-22 00:55 +0200 |
| Subject | Re: terminology |
| Message-ID | <jmvdt9$s4e$1@news.albasani.net> |
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
[toc] | [next] | [standalone]
| From | Jan Burse <janburse@fastmail.fm> |
|---|---|
| Date | 2012-04-22 01:06 +0200 |
| Message-ID | <jmveh0$t77$1@news.albasani.net> |
| In reply to | #13769 |
Jan Burse schrieb:
> 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?
Oops, the CheckingAccount from the paper is a factory method,
which has a result value. So the above doesn't work. Forget
about it...
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.java.programmer
csiph-web