On Fri, 11 Jun 1999, Craig Dickson wrote:
> I don't see that underscores serve readability in the same way as Hungarian
> notation purports to (unless the Eiffel people claim that underscores
> somehow convey type information?), so I don't see a conflict here. One could
> easily use both, e.g. n_widget_count for an integer value.
The only readability advantage of underscores is when
someone starts including abbreviations within the names.
PAToVA?
PAtoVA?
PA_to_VA? [Whatever PA and VA means]
Often such abbreviations are not justifyable, but
some might be well known and accepted
within a given project.
What is important is a consistency - as you pointed it out
when speaking about "my", "own", "a" (
Smalltalk uses it too for local variables)
"the", etc.
But what really counts and is well stressed in Eiffel
are two things:
- avoid duality caused by side effects; that is: "set"
type procedures never-never return anything but void.
In low-level C programming practises people
often oversuse the mixed "get-set" approach.
Sometimes one does not have a choice (efficiency reasons)
but often it is just a matter of bad habits.
Fortunatelly, Haskell does not have this sort of problems.
- document your routines according to return types:
void - verbs to indicate actions [perhaps monads in
Haskell?]
bool - "True if .." or "Is ... ?"
other objects - nouns (possibly with adjectives)
Looking back on what Prelude does - I do not think
there is any consistent naming rule with respect
to a noun-verb question.
Jan