[erlang-questions] 回复: Is export always better than complie(export_all)?

Richard A. O'Keefe <>
Thu Jun 20 08:36:34 CEST 2013


I should point out that the advice "use -export, not export_all, and use it as
little as you can" is _exactly_ the same as the advice "declare every function
and top level variable 'static' if you possibly can" given to C and C++
programmers, and for the same reason, and the same as the advice given to Java
programmers "prefer private to protected, protected to (package), and package
to public; don't make a method or a field public unless you _have_ to in order
to get the job done".  There is nothing specific to Erlang here.

The whole _point_ of modules is to hide as much as you can.
See just about any good software engineering book.




More information about the erlang-questions mailing list