[erlang-questions] avoid -import. Why?
Mon Jul 9 00:16:37 CEST 2007
The programming_rules document is quite old and need to be updated but
I think most of it is still valid.
I think the "don't use import is still as valid as it was when the
written. The code is usually much easier to read when you can see from
the syntax which module the function you are calling resides in and
calls without module qualifier is local calls.
I know other variant of this rule where only very well known modules in stdlib
like lists are imported and all other calls uses explicit module qualifier.
The tool exref is replaced with xref since several years.
/Kenneth (OTP team at Ericsson)
On 7/9/07, Anthony Kong <anthony.hw.kong@REDACTED> wrote:
> Hi, all,
> In reading this resource (
> ), I found this statement,
> Don't use -import, using it makes the code harder to read since you
> cannot directly see in what module a function is defined. Use exref
> (Cross Reference Tool) to find module dependencies.
> I do not think I understand why it is the case, and could not find the
> tool exref from the erlang distribution.
> If anyone can shed some light, most appreciate.
> Cheers, Anthony
> Experience is simply the name we give our mistakes.
> ---- Oscar Wilde
> erlang-questions mailing list
More information about the erlang-questions