[Haskell-cafe] Re: Allowing hyphens in identifiers

Daniel Fischer daniel.is.fischer at web.de
Sat Dec 12 09:44:54 EST 2009

Am Freitag 11 Dezember 2009 01:20:55 schrieb Richard O'Keefe:
> On Dec 11, 2009, at 3:00 AM, Daniel Fischer wrote:
> > Am Mittwoch 09 Dezember 2009 23:54:22 schrieb Richard O'Keefe:
> >> Given the amazinglyUglyAndUnreadably baStudlyCaps namingStyle that
> >> went into Haskell forNoApparentReasonThatIHaveEverHeardOf,
> >
> > mb_t's_bcs the ndrscr_stl is considered far uglier and less readable
> > by others
> Come ON.  Argue honestly!

Thanks, but I have to return that compliment.

> The problem with that text is *NOT* the
> underscores but the insanely heavy abbreviation.

As stated in the parenthesis immediately afterwards.

> We all agree that
> insanely heavy abbreviation is bad, but do you *really* want to
> claim that
> 	mbT'sBcs the ndrscrStl isConsidered farUglier and lessReadable byOthers
> is readable?

I claim that the part not using insanely abbreviated words (isConsidered, farUglier, 
byOthers) *is* readable.
Also that moderately abbreviated words are readable in camelCase as well as under_score.

> > (granted,
> > underscore-style with nonabbreviated words is not unreadable, but
> > still extremely ugly)?
> Who "grants" that underscore separation with fully written words is
> "still extremely ugly"?  Not me!

Is that remark really unclear, or did you intentionally choose the bracketing you did to 
make a polemical point? (This is a serious enquiry about the English language. In German, 
the analogous construction to "granted, a, but b" ["zugegeben, a, aber b"] is parsed 
"(granted, a), but b", can it really be parsed as "granted, (a, but b)" in English?)

(granted, ... is not unreadable. But it is still ...)
Clearly, *I* grant - or admit, concede - that it is *readable*.
Nobody *grants* anything is ugly or not, that is an aesthetic judgment, as such entirely a 
matter of personal preference - you can agree with it or not.

> I don't believe that it _is_ a matter of personal preference.

I believe that even readability is strongly influenced by personal preference (more by 
experience - what you're used to).
However, the sentence about preference was more concerned with aesthetics.

> I have not been able to discover an experimental study of word
> separation style effect on readability in programming.  I've been
> wondering about running a small one myself, next year.  But there
> is enough experimentally determined about reading in general to
> be certain that visible gaps between words materially improves
> readability, and internal capital letters harm it. Now that
> applies to ordinary text, but until there's evidence to show that
> it doesn't apply to program sources, it's a reasonable working
> assumption that it does.

I doubt that. Sourcecode is so different from ordinary text (a line of sourcecode rarely 
contains more than four or five words), that I'd be very wary to transfer the findings for 
one to the other.
If somebody claimed that of

x <- take_while some_condition some_list


x <- takeWhile someCondition someList

either was objectively more readable than the other, I wouldn't believe it without lots 
and lots of hard evidence.
I believe you find the first more readable, however, for me the underscores push the 
space-separated parts together, so that I have the tendency to bracket it

x <- take (while some) (condition some) list

on first glance. It resolves when focusing on the line, however.
(And, of course, the problem doesn't turn up for
x <- take_while (<= 1000) [3,7 .. ]
or similar.)

More information about the Haskell-Cafe mailing list