[racket] Should we _always_ use `only-in` or `prefix-in` when `require`-ing packages?

From: Jose A. Ortega Ruiz (jao at gnu.org)
Date: Mon Nov 18 23:46:43 EST 2013

On Mon, Nov 18 2013, Matthew Flatt wrote:

>  * Always using `only-in` or `prefix-in` seems too painful. (We know
>    that in some languages it's conventional to always prefix imports,
>    but those languages don't consider things like `lambda` or the
>    application form to be imports.)

Not sure if you're referring to writing or reading programs using
prefixes as too painful.  I find prefixed names much more convenient
when reading programs because one knows where a name comes from at a
glance: reading code in a module importing a dozen other modules is, at
least to me, easier with prefixes.

I know in DrRacket you can mouse over to get that info, and in Geiser,
my emacs thing, the echo area shows the signature of the function at
point, and includes the module where it's defined as part of its name;
but in both cases you get information about just one identifier: with
prefixed names you "see" that information quicker, and more of it at
once.

(For lambda or application one can always use only-in... i would say
that those are the exception more than the rule in "normal" development,
but perhaps it's just my lack of experience).

Cheers,
jao
-- 
The surest way to corrupt a youth is to instruct him to hold in higher
esteem those who think alike than those who think
differently. -Friedrich Nietzsche, philosopher (1844-1900)


Posted on the users mailing list.