Skip to content

Commit abf619a

Browse files
Add guidelines about exports
1 parent 0db8a75 commit abf619a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

coding-style.rst

+13
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,19 @@ Multi-line ::
212212

213213
where
214214

215+
Exports
216+
-------
217+
218+
* Export symbols explicitly. Rationale:
219+
220+
* If not explicitly exported, you may miss unused functions in the
221+
module as all functions get exported by default. For example, you defined
222+
a benchmarking function but did not add it to benchmarks list. It will
223+
never be reported as it is treated as used via implicit exports.
224+
* Compiler optimizations get impacted due to exporting because the compiler
225+
has to optimize the function and put it in the interface files.
226+
Optimizations work better and are more efficient if you explictly export.
227+
215228
Imports
216229
-------
217230

0 commit comments

Comments
 (0)