Skip to content

Commit

Permalink
add guideline to dissuade assertion abuse (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrevels authored Dec 30, 2019
1 parent ed0ddf9 commit 08817eb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,4 @@ Note that lines containing only comments are not considered empty lines.
- When overloading a function from another module, the function name should be qualified with its module (e.g. `imported_function(...) = ...` is bad, `ParentModule.imported_function(...) = ...` is good).
- Modules should only be loaded with `using`, never `import`. This helps prevent methods from being accidentally extended without qualification (whereas `import Module: f` allows `f` to be extended without qualification).
- It's friendly to selectively `export` module bindings, but unfriendly to `export` *everything*. A module should `export` unambiguously named bindings that are part of the module's intended API. It's also okay to not export (but document) functions that are intended to be called in qualified form, e.g. `CSV.read`.
- Do not use `@assert` statements for any error handling/input checking/etc. that should occur even in optimized builds. Per `@assert`'s documentation: "An assert might be disabled at various optimization levels."

0 comments on commit 08817eb

Please sign in to comment.